Set Workflow Timeouts

Set a timeout for a workflow by passing timeoutMS to DBOS.startWorkflow. When the timeout expires, the workflow and all its children are cancelled. Timeouts are

Marketing
bykursku150 words

What is Set Workflow Timeouts?

What this skill does

This skill enables marketers to set explicit timeouts on workflows by passing a timeout value in milliseconds (`timeoutMS`) when starting a workflow via `DBOS.startWorkflow`. When the timeout period expires, the workflow along with all its child workflows are automatically cancelled. Timeouts begin counting from the moment the workflow starts execution and persist even if the system restarts, ensuring durable enforcement for workflows that may run for minutes, hours, or longer.

Using timeouts prevents workflows from running indefinitely or getting stuck, which can distort campaign timing, delay data processing, or tie up system resources. Cancellation of a workflow happens cleanly at the start of the next step, allowing the current step to finish and maintain data integrity before termination.

Who it's for

This skill is designed for performance marketers managing complex multi-step campaign automations that require predictable execution windows. Growth leads running workflows that integrate data pipelines, ad platform syncs, or automated bidding adjustments will find it essential for enforcing deadlines. Agency strategists coordinating client-side workflows across different platforms benefit from reliable timeout controls to avoid cost overruns or stale actions in long-running processes.

In any scenario where workflows may hang or exceed expected durations—such as batch SEO audits, PPC bid recalculations, or multi-channel attribution updates—this skill supports operational discipline and timely decision-making.

Key workflows

A typical workflow begins with registering the business logic function using `DBOS.registerWorkflow`. Marketers then start the workflow with `DBOS.startWorkflow`, attaching a `timeoutMS` parameter to define the maximum runtime. During execution, the timeout counter runs from the first step, not queuing delays, ensuring strict adherence to time limits.

If the timeout expires, the workflow and all its child workflows are cancelled at the start of the next step, preventing partial executions or resource locking. After cancellation, monitoring tools or alert systems can capture the event for troubleshooting or retry logic. Adjusting timeout values dynamically based on historical runtime metrics helps fine-tune workflow performance and avoid premature cancellations.

Common questions

How does the timeout affect currently running steps? The current step completes before cancellation begins at the next step boundary. Can timeouts persist through system restarts? Yes, timeouts are durable and continue counting after restarts. What happens to child workflows if the parent times out? All child workflows are cancelled along with the parent workflow.

How to use in Metaflow

Attach the Set Workflow Timeouts skill to a Metaflow agent task by configuring the workflow start call to include the `timeoutMS` parameter with your desired timeout duration. Expect workflows to be automatically cancelled if they exceed the specified time, along with any child workflows they spawned. This provides a reliable safeguard against runaway executions and helps maintain predictable campaign timing and resource usage. We recommend monitoring cancellation events closely and tuning timeout values based on observed workflow durations.

For broader context, see our roundup of claude skills marketing, and read how to create Claude skills for related setup guidance.

Related skills