Campaigns Fail with “While running this query the system timed out” Error

Overview

This knowledge base article explains the root cause and resolution for campaigns that fail with the error message “While running this query the system timed out”. This issue typically occurs when campaigns query a large volume of data from the Campaign Recipients (CRT) table due to an extended Delivery Date filter.

Problem

You may observe that one or more campaigns fail during execution with the following error:

While running this query the system timed out. This error is safe to retry. If it continues to fail, try to optimize the query. If the query references the campaign_recipients table, please make sure it is filtered by 'delivery_date' to only the range required.

Common Symptoms

  • Multiple campaigns fail simultaneously
  • Campaigns reference the Campaign Recipients table
  • Campaigns have a wide Delivery Date filter (for example, going back several months)
  • Failures often occur when multiple campaigns run at the same time

Root Cause

The primary cause of this issue is a large data scan on the Campaign Recipients (CRT) table.

In affected campaigns, the audience filter is typically configured as:

Anyone from Campaign Recipients whose Delivery Date is after a very old date

This configuration causes the system to scan and process a very large dataset (e.g., 150+ days of data). When multiple campaigns run concurrently using the same wide date range, the query exceeds system time limits, resulting in a timeout.

There is no platform defect or campaign configuration issue—this is a query performance limitation due to data volume.


Solution / Recommended Action

To resolve the issue, optimize the campaign audience filter by reducing the Delivery Date time range.

Recommended Best Practices

  • Limit the Delivery Date filter to only the required time period
  • Use a 30-day delivery date range where possible
  • If needed, extend up to 90 days, but avoid larger ranges unless absolutely necessary

After updating the filter:

  1. Save the campaign
  2. Retry or re-run the campaign
  3. Monitor execution for successful completion

Additional Notes

  • This error is safe to retry, but retrying without optimizing the filter may result in repeated failures
  • Running multiple campaigns simultaneously with large CRT scans increases the likelihood of timeouts

Contacting Support

If the campaign still fails after reducing the Delivery Date range and optimizing the audience filter:

  • Capture the campaign ID(s)
  • Note the updated filter configuration
  • Contact Amperity Support for further investigation

Summary

Campaign timeout errors are caused by querying excessive historical data from the Campaign Recipients table. Reducing the Delivery Date filter to a shorter, business-appropriate range (30–90 days) significantly improves performance and prevents campaign failures.