Naar inhoud springen

Automation

Flow steps

Flow steps control the path a workflow takes. Start and end a run, branch, loop, handle errors, wait, keep variables, and call other workflows.

Deze pagina is nog niet vertaald. Je leest het origineel.

Flow steps decide which way a run goes, repeat work, handle errors, pause, remember values, and hand work to other workflows.

Start and finish#

StepWhat it does
BeginThe single starting point of every workflow. Its outputs are the workflow's inputs. Whatever starts the workflow, whether a button, a schedule, a rule, another workflow, an email, or a manual run, arrives here.
ReturnEnds the run successfully and sets the workflow's result. A workflow that called this one and waited for it receives that result.
AbortStops the run as failed. Use it when continuing would be wrong and no later step should run.

Decisions#

StepWhat it does
BranchFollows the True or False path based on a yes-or-no value, for example "Amount is more than 10,000".
Switch EnumFollows the path that matches one of a fixed set of labels. Use it when a decision has more than two outcomes, such as a priority of low, medium, or high. Define the labels with Make Enum.
Validate SchemaChecks a value against a shape you define, such as required fields and formats like email or date. Continues on Valid, or on Invalid with the list of problems. Use it at the start of workflows whose inputs come from outside, such as an email or an HTTP call.

Loops#

StepWhat it does
For EachRuns the Body path once for each item in a list, then continues on After. This is how you handle every record from a read, or every file on a record.
For LoopRuns the Body path a set number of times, then continues on After. Use it when there's no list to walk.

Errors#

Try / Catch / Finally protects a group of steps.

  • Body holds the steps that might fail, such as a call to another system.
  • Catch runs if something in the body fails. Add Break Error to read the error's code, message, and the step that failed.
  • Finally runs on the way out, whether the body failed or not. Keep it short. It can't contain a wait.
  • After continues the workflow.

Use it to record a failure, undo earlier work, or carry on with a fallback instead of failing the whole run.

Waiting#

Wait pauses the run for a set time, then continues. The duration is in milliseconds, so one hour is 3,600,000. A waiting run is kept safely and continues even after a restart, so it suits "remind them in three days".

To retry a failed call, use Try / Catch / Finally instead of a wait.

Variables#

Variables hold values while the run goes on. Create them in the Variables panel.

StepWhat it does
Set VariableStores a value under the variable's name.
Get VariableReads a variable's current value.
Push to Array VariableAdds one item to a list variable. Use it to collect results inside a loop, such as the files to put in a ZIP.

Logging#

Log writes a message into the run's log, so whoever looks at the run later can see what happened and what values the workflow had.

Other workflows and functions#

StepWhat it does
Subflow CallStarts another workflow. Pick the workflow, then fill in its inputs. Under Wait for completion?, choose whether this run waits for the other one to finish and uses its result, or starts it and carries on.
Function CallRuns a function inside this same run and uses its outputs.
Function In, Function OutThe start and end of a function. They appear only when you edit a function, and hold the function's inputs and outputs.

Use a function when the same group of steps appears in several places. Create it in the Functions panel, and use Make global to share it with other workflows. Use Subflow Call when the work should be a separate run with its own history.

Plan the flow#

Name each branch and what it means for the business. Name the list a loop walks, such as "each open invoice". Give each wait its duration, and say whether a called workflow is waited for.

Loop je vast of mis je iets? Vraag het de community.

Vraag het de community

Bekijken als MarkdownVerbetering voorstellen