---
title: "Workflow References"
description: "How a step's settings read trigger and step output, the current loop item, inputs and system values; where a step can go; and what an If/Else condition can test."
---

{/* Generated by projects/publicApi (npm run docs:website:generate) from the code that parses references, places steps and checks conditions. Do not edit by hand: docs:check fails when this page differs from the code. */}

A value in a step's or trigger's configuration can read data from earlier in the run with a reference in double braces, such as `{{ steps.<stepId>.output[0].email }}`. Text around a reference is kept: `Hello {{ steps.<stepId>.output[0].firstName }}`. [Update Workflow Step Configuration](/docs/api/rest/actions/update-workflow-step-configuration) refuses a reference to a step that does not come before the one being set up, and [Get Workflow Step Schema](/docs/api/rest/actions/get-workflow-step-schema) lists the output fields each step offers.

## References

| Reference | Reads |
| --- | --- |
| `{{ steps.<stepId>.output }}` | Every record a step returned, as a list. The step must come before the one that references it. |
| `{{ steps.<stepId>.output[0].<field> }}` | One field of one record: `[0]` is the first record. Dot further into nested objects: `output[0].address.city`. |
| `{{ steps.<stepId>.output[].<field> }}` | That field of every record, as a list. |
| `{{ steps.<loopStepId>.output[0].<field> }}` | Inside a loop: the current item. Each run of the loop's body sees the loop step's output as a list holding just that item. |
| `{{ trigger.<triggerId>.output... }}` | The trigger's output, addressed the same way as a step's (a webhook's body, query and headers; an app event's records). |
| `{{ workflow.inputs.<key> }}` | A workflow variable's value for the run's environment (Get Workflow Inputs). |
| `{{ function.inputs.<key> }}` | Inside a function: an input the calling workflow passed. |
| `{{ integration.metadata.<key> }}` | In an integration workflow: a value from the installation's metadata. |
| `{{ system.<name> }}` | A value the platform supplies when the step runs: one of the names below. |
| `{{ memory.<path> }}` | A value a Memory step stored earlier, by its path. |
| `{{ item.<path> }}` | Inside the `each` of a `$map` (an app step argument that is a list of rows, built one row per record): a field of the record being mapped. A Map step's JavaScript reads its inputs differently: Built-in Steps describes it. |

### System values

| Reference | Value |
| --- | --- |
| `{{ system.environment }}` | Environment |
| `{{ system.installationId }}` | Installation Id |
| `{{ system.lastSuccessfulStartedOn }}` | Last Successful Start Date |
| `{{ system.lastSuccessfulFinishedOn }}` | Last Successful Finish Date |
| `{{ system.now }}` | Now |
| `{{ system.oneHourAgo }}` | 1 Hour Ago |
| `{{ system.sixHoursAgo }}` | 6 Hours Ago |
| `{{ system.twelveHoursAgo }}` | 12 Hours Ago |
| `{{ system.oneDayAgo }}` | 1 Day Ago |
| `{{ system.oneWeekAgo }}` | 1 Week Ago |
| `{{ system.oneMonthAgo }}` | 1 Month Ago |
| `{{ system.twoMonthsAgo }}` | 2 Months Ago |
| `{{ system.threeMonthsAgo }}` | 3 Months Ago |
| `{{ system.sixMonthsAgo }}` | 6 Months Ago |
| `{{ system.oneYearAgo }}` | 1 Year Ago |

## Lists built from earlier records

An app step argument that is a list of rows can be built one row per record of an earlier output with `{ "$map": "{{ steps.<stepId>.output }}", "each": { ... } }`: inside `each`, `{{ item.<field> }}` reads the record being mapped, as in `{ "$map": "{{ steps.<stepId>.output }}", "each": { "sku": "{{ item.sku }}", "qty": "{{ item.quantity }}" } }`. `$map` works only in such an argument. A Map step is JavaScript instead: [Built-in Steps](/docs/api/rest/introduction/built-in-steps) describes it.

## Where a step goes

[Add Workflow Step](/docs/api/rest/actions/add-workflow-step) and [Duplicate Workflow Step](/docs/api/rest/actions/duplicate-workflow-step) take a position: `{ parentStepId, slot, afterStepId }`. [Set Workflow Step Order](/docs/api/rest/actions/set-workflow-step-order) nests steps under the same slot names.

| slot | Where |
| --- | --- |
| `steps` | The top level of the workflow. |
| `body` | Inside a loop, a folder, or a step that pages in batches: the steps that run for each item or page. |
| `then` | The If/Else lane that runs when its conditions are true. |
| `else` | The If/Else lane that runs otherwise. |

## If/Else conditions

An If/Else step's `condition` argument is a condition, `{ field, operator, value, type }`, or a group, `{ conjunction, where }`: `conjunction` is `and` or `or` and each item of `where` is a condition or another group. `disabled: true` on a condition or group turns it off. `field` and `value` are text or references; `type` says what to compare them as: `string`, `number`, `boolean`, `date`, `array`, `object`. [Get Workflow Step Schema](/docs/api/rest/actions/get-workflow-step-schema) describes the arguments of an If/Else step you have added.

| operator | Tests | value |
| --- | --- | --- |
| `eq` | Equals | one value |
| `ne` | Does Not Equal | one value |
| `gt` | Is Greater Than | one value |
| `lt` | Is Less Than | one value |
| `gte` | Is Greater Than or Equals | one value |
| `lte` | Is Less Than or Equals | one value |
| `contain` | Contains | one value |
| `ncontain` | Does Not Contain | one value |
| `between` | Is Between | a list of values |
| `exist` | Exists | no value |
| `nexist` | Does Not Exist | no value |
| `includes` | Includes | a list of values |
| `empty` | Is Empty | no value |
| `nempty` | Is Not Empty | no value |
| `startsWith` | Starts With | one value |
| `nstartsWith` | Does Not Start With | one value |
| `endsWith` | Ends With | one value |
| `nendsWith` | Does Not End With | one value |

How values compare when the step runs:

- gt, gte, lt, lte and between compare a field of type string with its value character by character, by character code: alphabetical, and case-sensitive, with every capital letter before every lowercase one ("Z" < "a").
- eq and ne compare the two as text, so 5 eq "5" holds; contain and ncontain look for the value anywhere in the field, and startsWith, nstartsWith, endsWith and nendsWith at its start or end, all case-sensitive ("dana" does not start with "D").
- In an If/Else condition between excludes its two ends: between [1, 10] holds for 2 to 9. A step filter's between includes them.
- Use type number to compare numbers as numbers and type date to compare dates.

## Paging a step

An app step whose action reads in pages takes the `pagination` option, `{ mode, size, page, rememberPage, resetWhenTotalReached, maxPagesPerRun, onMaxPages }`; [Get Workflow Step Schema](/docs/api/rest/actions/get-workflow-step-schema) says whether the action pages, which modes it takes and its page size bounds. Unset or null, paging is off: the step makes one request for the first page only, at the action's default page size (Get Workflow Step Schema's size.default: the app's default, 25 when it sets none), so a list longer than one page is cut short. To read more, set pagination: mode all reads every page of an action that can ask for later pages; an action that pages by size only takes mode single (Get Workflow Step Schema lists the modes an action takes), so raise its size, up to size.max.

| mode | Reads |
| --- | --- |
| `single` | One request: the page given by page (1 by default) of size records. |
| `all` | Every page, read one after another in this run, returned as one output. |
| `batch` | One page at a time: the steps nested inside this step run for each page before the next is read. |

| Setting | Meaning |
| --- | --- |
| `mode` | single, all, batch: how pages are read (below). |
| `size` | Records per page, within the size bounds Get Workflow Step Schema answers. |
| `page` | single mode: the page to read, from 1. |
| `rememberPage` | batch mode: the next run starts after the last page read, instead of at the first. |
| `resetWhenTotalReached` | batch mode with rememberPage: start over at the first page once every page was read. |
| `maxPagesPerRun` | batch mode: read at most this many pages in a run. |
| `onMaxPages` | batch mode: end or continue, what the run does after maxPagesPerRun pages. |

[Run Universal Action](/docs/api/rest/actions/run-universal-action) pages with `limit` and `offset` for every provider, including those that page by cursor: MindCloud reads as many of the provider's pages as `offset + limit` needs, up to 5,000 rows. `meta.cursor` in its answer is the provider's own cursor, for information; it cannot be sent back.
