In this module, we will learn what events are and how they work.
What are events?
Events are the data passed between different actions in a Tines workflow.
When an action runs, it emits events containing data. The next action in the workflow receives those events as input.
Events have:
Structured data: Events contain JSON* data with relevant information from the previous action.
Timestamps: Events are time-stamped, so you know exactly when they occurred.
Audit trail: Since events are immutable (unchangeable), they provide an audit trail of what happened.
Metrics: The timestamps and data in events make them useful for calculating important metrics.
So, in short, events represent the output of one action used as input for the next action. They allow actions to communicate and pass data through a workflow.
Event data example:
{
"kickoff": [
{
"email": "johndoe@example.com",
"name": "John Doe",
"ip": "192.168.1.1"
},
{
"email": "lousmith@example.com",
"name": "Lou Smith",
"ip": "192.168.1.2"
},
{
"email": "mike@example.com",
"name": "Mike Smith",
"ip": "192.168.1.3"
},
{
"email": "franklinthomas@example.com",
"name": "Franklin Thomas",
"ip": "192.168.1.4"
},
{
"email": "janedoe@example.com",
"name": "Jane Doe",
"ip": "192.168.1.5"
},
{
"email": "gerg@example.com",
"name": "Greg Smith",
"ip": "192.168.1.6"
}
]
}
*JSON: explained
💡Note
What can we do with event data?
We can create decision trees with triggers using event data.
Example: We reach out to a service and get a 200 on the HTTP status. This means that we had a successful request to the service. We can then create a trigger so we only continue the story if the HTTP status is 200 and ignore the other codes.
HTTP status codes let us know the status of any API request / HTTP request that we make to a given service.
We can modify the data using functions.
Taking a value and making various modifications, we can do something simple like sorting a list or leveraging LAMBDA functions to apply complex logic. Let’s take a look at a basic example.
We’ll learn more about ways to leverage formulas in a later module, but we wanted you to be aware of their power to manipulate events.