Files
nextcloud-docs/admin_manual/windmill_workflows/index.rst
Marcel Klehr b2e8b3b767 Add admin docs for the windmill integration
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-09-04 10:15:12 +02:00

35 lines
1.9 KiB
ReStructuredText

==================
Windmill Workflows
==================
Nextcloud integrates the Windmill workflow engine (https://www.windmill.dev/) to allow advanced custom workflows interacting with your Nextcloud instance.
Installation
------------
* Install Windmill
* Either as a standalone install or via the Windmill External App in Nextcloud (see :ref:`External Apps<ai-app_api>`)
* Enable the ``webhook_listeners`` app that comes with Nextcloud
.. code-block:: bash
occ app:enable webhook_listeners
Building a workflow
-------------------
Each workflow in windmill is a listener to a Nextcloud Webhook Event. If you are using the ExApp-packaged windmill, it will automatically register webhooks for the workflows you build using the following mechanism. If you are not using the ExApp-packaged windmill install then you will have to register webhooks for your workflows manually via the webhook_listeners API: see https://docs.nextcloud.com/server/latest/developer_manual/_static/openapi.html#/operations/webhook_listeners-webhooks-index
The magic listener script
~~~~~~~~~~~~~~~~~~~~~~~~~
The first script in any workflow you build that should listen to a nextcloud webhook must be ``CORE:LISTEN_TO_EVENT``. It must be an empty script with two parameters that you should fill statically: ``events``, which is a list of event IDs to listen to and ``filters`` a filter condition that allows more fine grained filtering for which events should be used. The filter condition as well as the available events with their payloads is documented in :ref:`the webhook_listeners documentation<webhook_listeners>`.
Nextcloud Scripts
-----------------
Nextcloud makes available a variety of scripts to be used in Windmill for interfacing with Nextcloud apps. You can find them
at https://hub.windmill.dev/ or in your windmill instance when selecting existing scripts for creating a new workflow.