Use attributes from external events in Architect workflows
Use this procedure to read an attribute from an incoming event, such as an external event ingested through the API, and use it in an Architect workflow, for example as the text of a chat message in a Send Notification action.
Before you begin
- The external event-based trigger is configured. For more information, see Create an event-based trigger for external events.
- You know which attributes the event’s schema defines. Open the event in the Configurations list to see its schema attributes. For more information, see Manage schema.
Create a workflow
- Create a workflow in Architect that must run when the event occurs.
- Add a JSON input variable.
- In the workflow, create a variable of type JSON and name it. In the examples depicted in this procedure, the variable is named
jsonData. With the JSON data format, the entire event is sent to the workflow as a JSON object. Your workflow refers to this input variable asjsonData. - Select the Input to flow option.
- Ensure that the initial value is set as “NOT SET”.
- In the workflow, create a variable of type JSON and name it. In the examples depicted in this procedure, the variable is named
- Use the attribute in an action. The whole event is in
Flow.jsonData, so reference the attribute directly under it:ToString(Flow.jsonData.attributes.[attribute_name]). For example, to post the attribute to a group chat:- Add a Send Notification action.
- Select the chat notification type and select the group.
- Set the chat message to
ToString(Flow.jsonData.attributes.purchasePrice).
- Configure the event-based trigger to point to this Architect workflow as its Workflow Target.
- Test the trigger and confirm the attribute path.
- Send a real event. Ingest an event through the external events API, using the schema you configured. Confirm the workflow runs and the expression returns the attribute value.
When the event occurs, the trigger starts the workflow and passes the event as JSON in Flow.jsonData. The expression returns the attribute value for use in the flow.
[NEXT] Was this article helpful?
Get user feedback about articles.