Workflows Automations
Description
Automations allow you to automatically run workflows on top of folders in Latch Data when triggered by specific events such as when files are added to folders or after a regular interval of time has passed. Automations consist of a trigger and an automation workflow.
Additionally, you can inactivate and reactivate automations by toggling the status radio on the sidebar.
Triggers
Automation triggers specify the conditions needed to run the automation, such as “child got added to the target directory” or “time interval expired”.
Triggers are created and configured in the Latch console.
Available Trigger Types
Data Added
This trigger type runs an automation workflow if a new child has been added to the target directory at any depth (level of nested directory). The automation will not run if a child has been modified or deleted.
Trigger Parameters:
Input Target
: the target directory to watch for new children.Follow-up Update Period
: this is the wait period after the last trigger event after which the workflow will run.
For example, if this value is 10 minutes, the automation will run 10 minutes after a child has been added to the target directory.
Example: an automation with the Data Added
trigger type configured with Input Target
of directory /test
and Follow-up Update Period
of 10 minutes will run the automation workflow 10 minutes after the last child is added at any depth to /test
directory in Latch Data.
Interval
This trigger type runs automation workflow on a regular time interval specified by the user.
Trigger Parameters:
Interval
: the time interval that will activate a trigger
Example: an automation with the Interval
trigger type configured with Interval
of 1 hour
will run the automation workflow hourly.
Automation Workflow
This is the workflow that will run whenever the automation has been triggered.
Usage Note:
-
When using
Data Added
trigger, the automation workflow function must haveinput_directory: LatchDir
as the only parameter, else the automation will fail to start.Required Workflow Definition:
-
When using
Interval
trigger, the automation workflow function must have no parameters, else the automation will fail to start.Required Workflow Definition
In case you need more parameters to pass your workflow, we suggest to hard-code them into your workflow while we are working on adding parameter support for automations.
Examples
For step-by-step instructions on how to create automations, checkout our examples on how to create Data Added and Interval automations.
Creating an Automation
-
Author an automation workflow in Python with the Latch SDK and register it with Latch. See Usage Note to make sure that your workflow can be run by automations.
-
Navigate to Automations tab via Worfklows > Automations and click on the Create Automation button.
-
Input an Automation Name and Description.
-
Select the
Event Type
. Refer to the Available Trigger Types for explanation of trigger behaviors. -
Specify
Follow-up Update Period
orInterval
depending on the type of the trigger you have selected. -
(For
Data Added
trigger) select a folder where files/folders will be uploaded using theSelect Target
button. Any items uploaded to this folder will trigger the specified workflow. -
Select the automation workflow that you have just registered with Latch.
-
See our examples for step-by-step instructions on how to create automations.
Configuring Automations
If you want to configure the name, description or wait intervals or delete your automation, you can do so in automation settings.
-
Navigate to Automations tab via Worfklows > Automations and click on any of your automations.
-
Click on the settings tab on the selected automation overview page.
-
Update any information that you want on the settings page.
-
Click
Save Changes
to persist your updated settings.
Was this page helpful?