Input mapping
Scenarios are data centric. Either incoming event serves as an input to a scenario, or steps can fetch data from external systems and then pass the data to next steps.
Step input structure
Section titled “Step input structure”Input of each step consists of mapped values along with standard fields. Standard fields include results of previous steps, along with current/previous step metadata, scenario inputs, and scenario metadata. We call it “Step Context”.
A list of standard fields is shown in the table below.
Field name | Description |
---|---|
steps[‘step-id’] | an object containing information about step with the given ID |
**steps[‘step-id’].**inputs | inputs of the previous step |
steps[‘step-id’].outputs | outputs of the previous step |
steps[‘step-id’].label | label of the previous step |
steps[‘step-id’].type | type of the previous step |
scenario | an object containing scenario metadata |
scenario.instance_id | ID of the current scenario instance |
scenario.inputs | inputs of the current scenario instance |
👉 Template syntax is based on Jinjava: https://github.com/HubSpot/jinjava
Mapping Syntax
Section titled “Mapping Syntax”Steps may have input parameters. Input parameters values are defined by input mappings. Input mapping is a JSON Schema, which determines how values from the step context are mapped into step input fields.
For example, the following input mapping:
{ "message_body": "{{steps['81e91f5f-f6ea-4d11-b504-bba0627b0c0e'].outputs.name}}"}
Tells the platform to take attribute “name” from the given step and use it as a value for the “message_body” input parameter of the current step.
Default interpolation result when nothing else can’t be inferred is string.
So this means the following mapping:
{ "message_body": "hello"}
And this one:
{ "message_body": "\"hello\""}
Will return the same value.