-
Notifications
You must be signed in to change notification settings - Fork 32
Steps
TechieGuy12 edited this page Jul 12, 2024
·
2 revisions
Note
Steps are available in version 2.x and higher.
Steps are the basic execution blocks for a workflow. They provide a series of tasks that will be performed within the workflow.
The structure of steps within a workflow is as follows:
<watches>
<watch>
<workflows>
<workflow>
<steps>
<variables></variables>
<step>
<id></id>
<needs></needs>
<variables></variables>
<action></action>
<command></command>
<notification></notification>
</step>
</steps>
</workflow>
</workflows>
</watch>
</watches>
A <steps>
element can contain the following child elements:
Element | Description |
---|---|
variables |
(Optional) The variables for all child steps. For more information, see Variables. |
step |
Each step to be executed. |
Each step element can contain the following elements:
Element | Description |
---|---|
id |
The unique identifier for the step within the workflow. |
needs |
(Optional) A list of steps that will need to completed before this step can run. For more information, see Needs. |
variables |
(Optional) The variables for all child steps. For more information, see Variables. |
action |
(Optional) The action to be performed. For more information, see Actions. |
command |
(Optional) The action to be performed. For more information, see Commands. |
notification |
(Optional) The action to be performed. For more information, see Notifications. |
Unlike a watch, a <step>
element can only contain one action, command, and notification.
The following is a config file showing a workflow with three steps:
<watches>
<watch>
<path>F:\Pictures</path>
<id>create-photos-watch</id>
<workflows>
<workflow>
<triggers>
<trigger>Create</trigger>
</triggers>
<steps>
<step>
<id>create-picture-get-checksum</id>
<command>
<path>C:\Tools\fv\fv.exe</path>
<arguments>-f "[exactpath]" -sf C:\Tools\fv\config.xml</arguments>
</command>
</step>
<step>
<id>create-picture-gotify-send-message</id>
<needs>
<need>create-picture-get-checksum</need>
</needs>
<notification>
<url>[env:gotify_url]/message</url>
<method>POST</method>
<data>
<headers>
<header>
<name>X-Gotify-Key</name>
<value>[env:gotify_key]</value>
</header>
</headers>
<body>
{
"message": "[message]",
"priority": 7,
"title": "Pictures Folder"
}
</body>
</data>
</notification>
</step>
<step>
<id>create-picture-plex-refresh-library</id>
<needs>
<need>create-picture-get-checksum</need>
</needs>
<notification>
<method>GET</method>
<url>[env:plex_url]/library/sections/1/refresh?path=[urlenc:F:\Pictures\[path]]&X-Plex-Token=[env:plex_token]</url>
</notification>
</step>
</steps>
</workflow>
</workflows>
</watch>
</watches>
The flow of execution for the steps defined in the workflow will be:
- The command
C:\Tools\fv\fv.exe f "[exactpath]" -sf C:\Tools\fv\config.xml
will be run for each file to generate a checksum as per thecreate-picture-get-checksum
step in the workflow in thecreate-photos-watch
watch. - After the
create-picture-get-checksum
step has completed, thecreate-picture-gotify-send-message
andcreate-picture-plex-refresh-library
steps in the workflow will then run because they have a need for thecreate-picture-get-checksum
step to complete.