DataFlow Tokens

Last Updated: May 14, 2020

Data flow tokens are variables for use with data flows. Like variables data flow tokens have a defined scope. Their values can be get or set in the individual patches that make up the data flow.

Token Scope

Data flow tokens have two possible scopes. Global tokens are available to all patches in all envelopes in the data flow. Envelope tokens are available only to patches within the same envelope. Envelope tokens take precedence over global tokens.

Using Tokens

Tokens read from global and envelope token lists before each patch is run. Token values will replace any properties they are bound to. Global and envelope token lists set after each patch is run using the response body's value to update the property a token is bound to.

Let's consider an envelope with the following patches:

  1. Create an account

  2. Add a contact to the account

  3. Add a product to the account

In order to add the contact and product to the account we will need the account's ID which we has not been created yet. This is where we would use a token. We create a token and bind it to the account ID. After we create the account the variable will be set with the return value for account's id. The subsequent patches can then use the id to know which account the contact and product will be added to.