Agent running too slowly — performance tips

Updated: 2026-07-22Reading time: 4 min

Identify the causes of slow agent execution in Cotonity and apply practical optimizations to reduce run times, from trimming unnecessary steps to enabling parallel execution.

Understanding execution time breakdown

Before optimizing, you need to know where the time is being spent. Open a recent run record in the Activity tab and expand the step-by-step trace. Each step shows its individual execution time in milliseconds. Look for steps that take significantly longer than others — these are your optimization targets. The most common slow steps are HTTP request steps that call external APIs with high latency, loop steps that process large lists sequentially, and AI inference steps that generate long outputs. Sorting the step list by duration (click the 'Duration' column header) gives you an at-a-glance view of the bottlenecks.

Reducing external API call latency

If HTTP request steps are the bottleneck, consider whether all of the API calls are strictly necessary for every run. A common optimization is to add a conditional step before an API call that checks whether the relevant data has changed since the last run — if not, skip the call entirely. For APIs that support bulk endpoints, replace multiple single-record calls inside a loop with a single bulk request outside the loop. If you need to call the same API endpoint multiple times within a run, enable step-level response caching in the step settings, which returns the cached response for subsequent calls within the same execution.

Parallelizing independent steps

By default, Cotonity executes workflow steps sequentially. If your workflow contains independent steps that do not depend on each other's output, you can place them inside a Parallel block to run them concurrently. For example, if your workflow fetches contact data from HubSpot and company data from Salesforce before combining the results, these two fetch steps can run in parallel, cutting their combined time roughly in half. To add a Parallel block, open the workflow editor, click the '+' between two steps, and select 'Parallel'. Drag the independent steps into the parallel branches, then add a Merge step after the block to collect their outputs.

Optimizing loops and list processing

Loop steps that iterate over large lists are one of the most impactful performance levers. First, reduce the list size before the loop by adding a Filter step upstream to discard irrelevant items. Second, check whether the operation inside the loop could be replaced with a single bulk API call — many CRM and data platform APIs offer batch create or batch update endpoints. Third, if the loop must remain but items are independent, enable 'Concurrent iteration' in the loop step settings, which processes up to ten items simultaneously instead of one at a time. Note that concurrent iteration is not suitable if items must be processed in a specific order.