Tasks in Tray.io
Connectors are the building blocks of Tray. All data, logic, and API calls must pass through at least one connector in order to be processed. The processing that occurs within these connectors is referred to as a 'Task'.
Tasks are what make all of Tray possible, and are therefore the core metrics used when determining the local data throughput necessary to perform Tray's logical operations. Tasks also are the highest consumer of all relevant metrics on our servers (internal calls, memory allocation, processing power, etc.)
Estimating your message count
The initial contributor to the total message count is the trigger. A single HTTP call or receipt of a WebHook counts as a single task. Tray must communicate with your service of choice to establish a secure connection, which makes this one of our more complex tasks. However, a single call is still treated as a single task.
In workflow diagrammed below, this step labeled as: <trigger>
Connectors and Looping
Each logical operation Tray performs to each piece of your data requires a task to be run. These connectors can be found under our 'Core' and 'Helpers' sections in the left-hand panel. Depending on how you configure your logic Tasks may run multiple times in a single instance of a workflow.
In workflow diagrammed below, these steps labeled as: <loop 2 times><boolean condition>
Tray allows you to pass your newly formatted and logically grouped data to the service of your choice. Each connection requires a task to run in order to establish the secure connection and pass the appropriate data.
In workflow diagrammed below, these steps labeled as: <Clearbit query><Slack notification>
The above query has 5 connectors included. This makes for a minimum of 5 tasks required to run a single instance of the flow. In our example, we have a loop. 2 data elements have come in from our trigger, which requires our loop to apply the entire logical set contained within the loop to each element. Therefore, this instance of the flow consists of 9 tasks.
Another great way to see how many tasks were required for a single execution of your flow is by going to the debugger. At the top of the workflow builder, click the Debug tab.
In the Workflow Logs, you will see each instance of your workflow that has been executed. Click on the instance to see the entire list of tasks required.
In the Run Logs, you will see each Task executed for a single instance of a workflow. Click on the Task to see the data that was processed.
Step-through of Tasks executed in the example workflow:
- A trigger was fired which brought back a list of 2 data elements.
- A call to Clearbit was made.
- The first list element was passed to the loop.
- The first list element was evaluated in a boolean.
- The first list element was sent to Slack in the form of a notification.
- The second list element was passed to the loop.
- The second list element was evaluated in a boolean.
- The second list element was sent to Slack in the form of a notification.
- The loop connector checked to ensure the last piece of data was processed. The check was TRUE, and the process exited.
A great way to get a quick overview of tasks run in your flow is by looking at the dashboard. In light grey text under the title of your workflow, you'll see the number of tasks processed by your workflow in the last 30 days. On the dashboard, tasks are currently referred to as 'messages'. In our example, the dashboard says 18 messages, as I executed the workflow 2 times (9 tasks per execution).