Understanding flow states

Zendesk Integration Services (ZIS) uses a JSON-based, structured language similar to Amazon States Language to define an integration. This language can define states in ZIS such as performing tasks, determining which states to transition to next, and stopping an execution with an error. A ZIS Flow is made up of one or more states.

State types

ZIS supports the following state types:

  • Action - Performs a task, such as transforming data or making a REST API call. See Action state
  • Choice - Adds conditional branching to a flow. See Choice state
  • Map - Enables looping or iterating over a set of input data. See Map state
  • Wait - Pauses for the specified number of seconds before transitioning to the next state. See Wait state
  • Succeed - Stops the flow in cases that are considered successful and passes a developer-defined message to the integration logs. Example: When a Choice state indicates no further action is required. See Succeed state
  • Fail - Stops the flow in cases that are considered errors and passes a developer-defined message to the integration logs. Example: When a Choice state finds an invalid input value. See Fail state
  • Pass - Passing a step's input to its output without doing any work. It can optionally add data to the output. Example: To mockup the result of a Choice or Action state for testing or debugging purposes. See Pass state

Common state properties

Most states support the following properties.

Name Type Mandatory Description
Type string true The state's type. For supported values, see State types. All states require Type
Next string Most state types require either Next or End Next state to run in the ZIS flow. You can't use Next and End in the same state. The Fail and Succeed state types don't support Next. The Choice state type supports multiple Next properties
End boolean Most state types require either Next or End If true, the state is terminal and ends the ZIS flow. A flow can contain multiple terminal states. End doesn't support a value of false. The Choice, Fail, and Succeed state types don't support End
Comment string false Human-readable comment
InputPath string false JSONPath to a part of the state's input. The state can only access this part of the input. Defaults to "$", the entire input
ResultPath string false JSON reference path used to the store the state's output. Later states of the ZIS flow can access the output at this path. The state's output is further filtered by OutputPath, if provided. Defaults to "$", which replaces the state's input with its output. The Choice, Fail, Succeed, and Wait state types don't support ResultPath
OutputPath string false JSONPath to a part of the state's output. The state only passes this part of the output to the next state. Defaults to "$", the entire output

For example, the following state includes the Comment, Type, ResultPath, and Next properties.

"SlackSettings.LoadConfig": {    "Comment": "Loads the Slack channel and ticket priority settings",    "Type": "Action",    "ActionName": "zis:common:action:LoadConfig",    "Parameters": {      "scope": "slack_settings"    },    "ResultPath": "$.config_result",    "Next": "NextState"}

Limitations

The documentation for each state type includes known limitations and differences from the Amazon States Language. ZIS flows also have the following limitations: