Chapter 11

Connect automations into workflows

Put automations on one map and connect them, so each row one automation finishes becomes new work for the next. You will create a workflow, connect two steps, decide when the next step runs, and try a failed row again.

11.1What a workflow is

A workflow connects automations on one map. Use one when the result of one automation should become the input of another. For example, one automation downloads remittance files and a second one posts each payment.

  • Each card on the map is a step. Each step is a complete automation with its own page, runs and schedules.
  • Each step has its own rows. One row is one piece of work, for example one remittance.
  • The Needs list on a card shows the fields that a row must have before it can run. The Produces list shows the fields that the step writes when it finishes a row.
  • A line between two steps is a connection. When the first step finishes a row, the connection creates a row in the next step. The new row carries the fields that you matched, plus the result of the first step.
  • Two steps on the same map are not connected until a line joins them.
  • Connections go one way. A connection that would send rows back in a circle is refused.

Workflows is in the header when your organization has at least one automation. Before that, it is in the Menu. The Workflows page also has a How hand-offs work link to a longer guide inside the product.

Important

Admins and managers create, change and delete workflows and connections. Everyone in the organization can open a workflow, watch it, run it and try failed rows again.

You can also start from a ready-made workflow in the library (see Browse the library).

Teach does not create workflows. An automation joins a workflow only when someone adds it.

11.2Create a workflow

  1. In the header, click Workflows. The Workflows page lists the workflows that have two or more steps first.
  2. Click New workflow. A list titled New workflow opens, with every automation in your organization, newest first.
  3. Click the automation that starts the work. To find it, type part of its name in Search automations. The workflow opens with that automation as its first step. A list titled Add step after and the step's name opens.
  4. Click the automation that comes next. It appears on the map, and a connection from the first step opens, already matched (see Connect two steps). Nothing goes live until you click Save connection.

The workflow takes the name of its first step. To rename it, click the pencil next to the name, or open More and click Rename.

The Add step after list shows first the automations that fit after the step. For example, fills 3 of 3 needs means that the step before has a field for each of its needs. The + after a step opens the same list. To add a step that is not connected yet, click Add step 1 in the page header, then click an automation.

If the automation that starts the work does not exist yet, click Teach an automation at the bottom of the New workflow list (see Teach a new automation). When it is built, start the workflow with it.

To teach a new automation in place, click + after a step, then click Teach a new step. Teach is told the fields that the step before produces. After the build, click the button Back to with the name of your workflow. The workflow opens on a matched connection that waits for Save connection.

There are two other ways to start a workflow from an automation:

  • On the Automations list, open the ... menu on the automation's row and click Create workflow from this. Or click a workflow under Add to workflow to add the automation to one you already have.
  • On the automation's page, click Connect in a workflow (see Inputs, outputs and default values).

Both open the new workflow with the Add step after list, the same as New workflow.

The map

When a workflow has steps, the page shows them on a map.

  • Add step 1 adds another automation to the map.
  • Each card 2 is a step. It shows the step's name, its status, its Needs and Produces lists, and how many of its rows wait, run or failed.
  • More 3 holds Rename, Tidy up, How hand-offs work and Delete workflow.
  • Run workflow 4 starts the first step with rows that you type or paste (see Run the whole workflow).
  • How work starts 5 lists each step that no connection feeds. For each one, it shows how the step starts, for example from its schedule or through the API. Its Run workflow and Add schedule buttons act on that step.
A workflow map: How work starts and the first step. The line to the second step goes past the right edge.
Figure 11.1A workflow map: How work starts and the first step. The line to the second step goes past the right edge.

Canvas and List under the map switch between the map and a list of the same steps. On a small screen, the list is the default. The list also works with a keyboard and a screen reader.

Click a step to open its panel on the right, with the tabs Overview, Rows and Settings. Click an empty part of the map to see the workflow summary, Before this runs on its own. The summary lists each place where rows would wait, and the cost of one row through every step.

Members who are not admins or managers see the same map without the controls that change it. A line under the title says Only admins and managers change steps and connections. Admins and managers might see a prompt for their second sign-in factor on their first change in a session.

Remove a step or delete a workflow

  1. Click the step.
  2. In its panel, click Settings.
  3. Click Remove from workflow. A dialog lists the connections that are deleted with the step. It also lists the connections that are kept, because both steps are also in another workflow.
  4. Click Remove step. The automation and its rows are not deleted.

Note

A connection to an automation outside this workflow keeps running after you remove the step. To delete it too, select Delete it too next to it in the dialog.

To delete a whole workflow, open More in the page header and click Delete workflow. The dialog says that the automations in it are kept. A checkbox, for example Also delete the 2 connections between its steps, is selected. Connections whose two steps are also in another workflow are listed as kept. Click Delete.

If a deletion stops before the end, the dialog lists the connections that it deleted. Click Try again to delete the others.

If something goes wrong

  • Only an organization admin or manager can configure a grid. when you create a workflow or add a step: only admins and managers can change workflows. Ask one of them.
  • Workflows could not load.: click Try again.
  • This workflow was deleted, or you do not have access to it.: click Back to Workflows.
  • Add step is not in the page header: you are not an admin or manager.
  • Every automation is already in this workflow.: click Teach a new step to make a new one.

A connection hands each row that one step finishes to the next step. You draw it from the step that finishes the work to the step that receives it. Nothing goes live until you click Save connection.

  1. Drag from the first step's card onto the second step's card. A dashed line marked Not saved appears, and the connection panel opens.
  2. Under Field matches 1, check the field that fills each need of the second step. Each need shows a sample value from the first step, when there is one.
  3. To match the fields by name again, click Match by name 2.
  4. If a need shows Choose a field..., open its list and select the field that fills it.
  5. If the second step needs a new field, click + New need and type its name. The field is made when you save.
  6. Under the question that asks when the second step should run 3, select an option. See When the next step runs.
  7. Under Which rows are passed on? 4, keep the rule that passes on only finished rows.
  8. Click Save connection 5. The line becomes solid or dashed, and the connection starts to work.
The connection panel: field matches, delivery, the rows that are passed on, and Save connection
Figure 11.2The connection panel: field matches, delivery, the rows that are passed on, and Save connection

There are other ways to start a connection:

  • Drag one field under Produces onto one field under Needs of the next step. The connection starts with that field match.
  • Click + after a step and click the next automation in the list.
  • Without a mouse, open the step's menu and select the next step under Connect to.

Match by name runs when the panel opens. It matches the exact name first, then the exact label. It never guesses. A need that no field fills says Rows will wait at Needs input until someone types it. One field can fill only one need. A match copies the value as it is, so a change to the value belongs inside an automation.

Important

A connection works for the whole organization when you save it. It creates rows and can start runs that use minutes.

The script of the second step must read the rows that a connection hands it. If it does not, the panel says so, and Save connection is grayed out.

Every connection adds one system field to the receiving step. It is named after the first step, for example Verify pharmacy licenses result. It holds the status of the first step for each row, such as done. You never type it.

  • Rows that already wait at the receiving step get manual in the new field, so they do not wait for it. Rows that you add by hand get manual too.
  • When you delete the connection, its result field is removed too, unless a connection out of the receiving step reads it. A field that a person made is never removed. Rows that waited only for the removed field are checked again.
  • If a connection out of the step reads the result field, the field stays when you delete the connection that filled it. Rows that arrive later wait for it, and the step card shows Rows wait for a result no connection sends any more. Change the connection out of the step so that it does not read the field. The field is then removed, unless another connection still fills or reads it.
  • If no connection fills a result field, the step card shows Rows wait for a result no connection sends any more with a Remove the field button for an admin or manager. Click it, and then click Remove the field in the dialog. The field is removed, and rows that waited only for it are checked again. It is refused while a connection out of the step reads the field.
  • A step can have at most 64 fields. The result field and each new need count toward that limit.

Two steps can hand rows to the same step only when both connections fill exactly the same needs. Then both share one result field, Result from the previous step. Rows from each step arrive separately and are never combined. A second connection that fills different needs is refused.

  1. Click the chip on the line between two steps. The connection panel opens.
  2. Change the field matches, the delivery or the conditions.
  3. Click Save connection. The change applies to rows that the first step finishes after you save.

The two steps of a connection stay fixed. To change either end, delete the connection and draw a new one. Rows that were already passed on stay where they are.

To delete a connection, click Delete connection at the end of the connection panel. A dialog titled Delete this connection? opens. If the connection is also in other workflows, the dialog names them, because deleting it removes it there too. Click Delete connection in the dialog.

What you see What to do
A step cannot hand rows to itself. Drag to a different step.
... Connecting back would loop forever. Rows would go around in a circle. Connect the other way, or delete the connection that points back.
Already connected. Open that connection. Click the line that is already there to change it.
... takes no inputs, so its script cannot read handed-off rows. ... That step makes its own rows. Teach it again with inputs, or ask a builder to add one.
... script never reads handed-off rows, so each row would run with its taught example values. ... Ask a builder to update the script, or teach the task again.
... has room for 1 more field. This connection needs 2. Remove a field that you do not need (Inputs, outputs and default values).
... already gets rows from ... Rows from each step arrive separately ... Match exactly the same needs as the first connection, or connect a different step.

11.4Run a workflow

Each step runs like any automation: from its own page, on its own schedule, or from its own triggers. A connection only creates rows in the next step. Something still has to start them.

When the next step runs

Each connection says how its rows start. You select one of three options in the connection panel.

Option What happens The line
Automatically The next step starts right after each successful run of the first step, as the person who started that run. A run with a failure starts nothing. Solid, with Automatic
The schedule, for example On Post payments' schedule The schedule of the next step starts its ready rows each time it runs. Dashed, with the next run time, for example Waits for 5:00 pm
When someone presses Run Rows wait as Ready until someone clicks Run on the step. Dashed, with Waits for Run

A new connection is set to Automatically only when the receiving step was taught as safe to run two times. Otherwise it is set to When someone presses Run, and the panel says why. You can change it to Automatically after you have watched a few rows.

  • A schedule on the receiving step is shared by every connection into it.
  • Typing a value, or a row that becomes Ready, never starts a run.
  • Runs use minutes like any other run. Before you save an automatic connection, the panel says about how many minutes each row takes. If your organization has no minutes left, or its billing is not active, you cannot save an automatic connection. Run buttons are also turned off, with the reason and a link to your plan.

Which rows are passed on

By default, a connection passes on only the rows that the first step finished. The panel shows this rule under Which rows are passed on?. To pass on fewer rows, click + Condition. Then select a need, an operator and a value. Status values show the words that you see on screen, such as Failed.

A connection made before this rule, or through the API, can pass on every row. Its line shows Gets unfinished rows. Click Only finished rows to change it.

  • A connection sends only new rows: the rows that the first step finishes after you save it. Rows that it finished before are not sent, unless one of them changes.
  • A row is passed on only when every field that the connection copies has a value.
  • A step with no needs makes one row each time it runs. Everything that one run finds reaches the next step as one row.
  • A row that the next step already started or finished is not changed.

Run the whole workflow

  1. In the page header, click Run workflow. A dialog opens.
  2. Under Start at, select the step to start from. Usually this is the first step.
  3. If the step has needs, select One row and fill in each field. Or select Paste rows, up to 200 and paste a table.
  4. Read What happens. It lists each step, where the run stops, and about how many minutes it takes.
  5. Click the run button, for example Run once.

The dialog says This is a real run. Steps do the work on the real sites and use minutes. After the run starts, the Activity drawer opens on Recent rows, with the new row at the top. If you start at a later step, the dialog adds Earlier steps do not run. A first step with no needs starts one run and makes one row.

Run only some rows

  1. Click the step that should run fewer rows.
  2. In its panel, click Settings.
  3. Under Step filter, click Add rule.
  4. Select a field, an operator and a value.
  5. Click Save changes.

The filter applies to every schedule on the step and to Run. Rows that do not match stay Ready and are checked again on the next run. If there is no step filter, every Ready row runs.

The step filter is the same rule as Only run some rows (optional) on the Run tab of the step's automation (Run only some rows). There, you can click Formula to write the rule as text.

Step filter reference

Each operator in the builder has a spelling in formula mode. In a formula, [column] is the key of a field.

In the builderIn formula mode
=[column]="value"
≠[column]<>"value"
>[column]>10
≥[column]>=10
<[column]<10
≤[column]<=10
containsCONTAINS([column],"value")
does not containNOT(CONTAINS([column],"value"))
is blankISBLANK([column])
is not blankNOT(ISBLANK([column]))

In a formula, compare a status by the word that it stores, not by the word on screen.

On screenIn a formulaMeans
Needs inputawaiting_gateA need is still empty.
ReadyreadyEvery need holds a value. The next run may take it.
RunningclaimedA run holds it now.
RetryingfailedIt failed and will be tried again on its own.
FailedabandonedIt failed and the step gave up on it.
DonedoneThe step finished it.

The examples below are written in formula mode. The step before them is Extract invoice. Its connection adds a result field that holds the status of each row in Extract invoice.

ExampleFormula
Only rows worth acting on. A business rule on a need. Most step filters look like this.=[amount]>1000
Only rows that carry a file. A blank check is safer than an equality when the step before may leave a field empty.=NOT(ISBLANK([invoice_url]))
Only rows Extract invoice finished. The rule every connection made in the editor already applies. Add it to a step fed by an older connection that passes on every row. Done is stored as done.=[from_extract_invoice_status]="done"
Only rows Extract invoice gave up on. Failed is stored as abandoned. failed is what Retrying stores, so comparing with it catches rows that may still finish. This matches only behind a connection that passes on every row, because a connection made in the editor passes on Done rows only.=[from_extract_invoice_status]="abandoned"
Finished, and worth acting on. Combine the result with a business rule. The builder joins rules with AND or OR; formula mode nests them.=AND([from_extract_invoice_status]="done",[amount]>1000)

If something goes wrong

If rows reach the next step but nothing runs, check these in order:

  1. The connection waits for Run, or for a schedule that the step does not have. The summary Before this runs on its own lists each place where rows wait.
  2. The rows show Needs input. Click the step, click Rows, and read the reason, for example Missing: Check amount. Match that field in the connection, or type the value in the row.
  3. The run of the first step had a failure. Automatic starts happen only after a successful run. A chip on the card, for example 3 ready rows missed the automatic start, has a button that runs them.
  4. No row arrived. A row is passed on only after the first step finished it. It also needs a value in every field that the connection copies. The connection panel counts the rows that were not passed on.
  5. The rows finished before you saved the connection. A new connection sends only new rows.
  6. The step filter matches nothing. Check it against a real row.

11.5Watch and try again

The map updates while you watch. Each card counts the rows that need input, are ready, are running or are retrying. Failed rows show as a red chip, and Done today shows as text. A chip names each place where rows pile up, with one button to fix it. Counts include rows from every workflow that the automation is in.

See what needs attention

  1. At the bottom of the page, click Needs attention in the Activity drawer. Failed rows are grouped by step, then by the run that failed them. Rows that are retrying are not listed. The step tries them again on a later run, and the Rows tab of the step says when.
  2. Read the title of each group. It shows the time of the run and its error.

See a row's journey

Click a row in Recent rows, in Needs attention or on the Rows tab of a step. The journey opens in the panel on the right. It shows each step that the row went through, how long it waited between steps, and where it stopped. In a HIPAA organization, values stay hidden until you click Show values. On a wide screen, the Activity drawer shrinks to its bar while the journey is open. To see the list in the drawer again, click Open on the bar or close the journey.

Try a failed row again

  1. Find the failed row in Needs attention, in its journey, or on the Rows tab of the step.
  2. Click Try again next to the row. In a journey, the button is Try again from with the name of the step.
  3. Read the dialog. It says how many times the step tried the row, and about how many minutes the next try takes.
  4. Click Try again.

Warning

Check the other system before you try again. If the step changes another system, the last try might have partly run.

The row runs again from the step that failed. Earlier steps do not run again. The row keeps its count of tries, so this is exactly one more try. Before the row runs, its needs are checked again. If a need is empty now, the row goes to Needs input instead.

Anyone in the organization can try a row again, and the dialog says Your name is recorded on this retry. A member who is not an admin or manager can try one row again up to three times. After that, the owner of the step, an admin or a manager must do it.

To change the values of the row first, click Edit and try again. Change the needs, then click Save and try again. Typing alone never starts a run.

Run again

A step with no needs makes its own rows, so its failed rows cannot be tried again. It shows Run again - makes a new row instead. That starts a new run, which makes a new row. The failed row stays Failed. The same applies to a row that a run made for itself, for example a run started from the API or a trigger.