Skip to main content

Workflow performance best practices

Learn about the best practices for building performant workflows.

Workflow performance issues can be difficult to replicate, especially when they involve external factors. The following best practices can help avoid problems and reduce the need to debug workflows.

Query best practices

Refer to the best practices guide for queries to learn more about writing performant queries for your data.

Retrieve only specific data from large datasets

Queries that retrieve large amounts of data impact workflow performance. The more data a workflow query requests, the longer it can take for the resource to complete the operation.

Query blocks have a maximum timeout of two minutes. Where possible, write queries that return only the results that the workflow needs (e.g., use API pagination and WHERE SQL query clauses).

Build workflows to perform specific tasks

Workflows time out after ten minutes and have 258MB of memory available. To avoid timeouts, build separate workflows to perform specific tasks instead of a single workflow that performs them together.

Trigger workflows only when needed

Workflows are rate-limited and have a minimum interval of one minute. Each workflow must also complete a run (whether successful or not) before it can be run again.

Whether you schedule a workflow to run automatically or trigger it using a webhook event, make sure that the workflow triggers only when it should run. This also helps reduce the amount of interactions a workflow has with your data source, which can reduce operational costs.