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.
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.
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:
Create an account
Add a contact to the account
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.