Write a workflow spec
A spec is an Unstract Flow workflow written as instructions to a careful colleague. Preparing turns what it says into the workflow's steps, and the workflow knows only what the spec tells it about your systems, so the more exact the spec, the closer the workflow comes to what you meant.
What a good spec states
- What one run works on. For example, "the next unread thread in @email_gmail" or "each new file in @extfs_s3 under
incoming/". - The steps, in order. Number them when the order matters.
- Every decision, with its exact rule. For example, "if the totals differ by more than 2%", or "if the vendor isn't in @file:vendors.csv".
- What to do when something goes wrong. Whether a loop carries on past a failed item, and what to do with an item that has disappeared from its source.
- Where results go, with exact names. Name the connector, the table and each field as your system spells them, for example "insert a row into the
paymentstable in @database withinvoice_id,amountandpaid_at". - Who checks what. Add a human review step covers review steps.
Split a spec across files
Add more Markdown files from the tabs above the editor. Preparing reads every file, in tab order. Deleting a file takes its content out of the workflow the next time you prepare. A workflow that opens read only for you shows its files without the buttons to add, rename or delete one; Members and roles says who can change a workflow.
Schedules
A schedule belongs to a deployment. Words such as "every Monday at 9am" in the spec set no schedule. When the spec has them, preparing shows "This workflow mentions a schedule" and points you to Deployments; write the timing in a scheduled deployment.
Notes for your team
HTML comments, written <!-- like this -->, stay in the editor and are removed before preparing reads the spec. Use them for notes that shouldn't become steps. Put each note on its own lines, close it with --> at the end of a line, and keep it under 50 lines; a note inside a quote is read as spec text.
- Every action a workflow takes goes through a connector. A step that needs something no connector offers fails the prepare when Flow can see that every run reaches it, with a message that says the workflow can't be built as written and names the step and the missing capability. A step inside a loop, a condition or a helper passes the prepare. So does a step after any loop or condition that can skip items, stop or end the run early. The run then fails when it gets there. Change the step to use a connector the workflow has, or add one.