Skip to main content

Schedule Triggers in Torq: Predefine Execution Timing

Learn how to schedule workflow executions for precise dates and times.

Updated yesterday

Use a schedule trigger in Torq when you need a workflow to run at specific dates or times. Common scenarios include:

  • Managing user onboarding/offboarding on a recurring basis, such as weekly tasks.

  • Conducting daily threat intelligence feed queries.

How to use

  1. Select the schedule trigger: Choose Schedule as the trigger type for the workflow.

  2. Create the trigger: For new workflows, select Create Workflow and choose Schedule.

  3. Define the frequency: Set how often the workflow should run, adjusting the available options as needed.

  4. Set the run time: Specify the exact time the schedule should trigger.

  5. (Optional) Replace a trigger: Replace an existing trigger with a different trigger type if your automation requirements change.

  6. (Optional) Add trigger conditions: Add trigger conditions to determine which events will start workflow executions.

  7. (Optional) View event history: View past trigger events to monitor activity, troubleshoot issues, or verify that events were received and processed correctly.

  8. (Optional) Resend events: Resend any past event, either to test the current workflow functionality or to rerun a production event.

The trigger event will include a timestamp for reference.

Run and test workflows

The Exit operator returns the data to the parent workflow in the case of nested workflows, and to the AI Agent or Socrates when the workflow is used as a tool.

  1. Execute a test run: After adding steps, click Test Run to manually initiate the workflow.

  2. Use trigger data: Incorporate event data in workflow steps with $.event.<parameter name>.

Publish and share workflows

Publishing and sharing help you manage workflow lifecycle and collaboration in Torq:

  • Publishing makes a workflow active and available for execution within your workspace.

  • Sharing allows you to distribute a workflow across multiple workspaces for reuse and collaboration.

Execution point alignment

When you create, edit, or publish a scheduled workflow in Torq, the system automatically realigns the next execution point. Instead of always running at fixed, universal times, the schedule shifts to align with the moment of creation or the most recent update.
For example, if you set up or republish a workflow at 16:23 with a 30-minute interval, the next run won’t happen at the nearest half-hour mark (16:30). Instead, it will run 30 minutes after the publish time, at 16:53.

If you edit and republish repeatedly, each publish shifts the next execution point further out in sequence.

Smart scheduling with nested workflows

Sometimes you may need a scheduled workflow that runs on a more customized schedule, for example, once every hour, but only during working hours on weekdays.

While the standard schedule trigger in Torq doesn’t support this level of granularity directly, you can easily achieve it using a nested workflow approach.

How it works

This approach uses two workflows:

  • A nested workflow that determines whether the workflow should run (based on working hours, days, and time zone).

  • A parent workflow with a standard schedule trigger that executes every hour and checks the nested workflow’s result before continuing.

Create the nested workflow

  1. Define workflow parameters: In a Parameters Utility step, add parameters for:

    • Working hours (e.g., 09:00–17:00)

    • Working days (e.g., Monday–Friday)

    • Time zone

  2. Build the logic: The workflow should evaluate the current time and return either:

    • true : Within working hours/days

    • false : Outside working hours/days

  3. Output: The nested workflow returns a simple boolean (true/false).

Set up the parent workflow

  1. Add a schedule trigger: Configure the out-of-the-box schedule trigger to run every 1 hour.

  2. Call the nested workflow: As the first step, use the nested workflow to check if it should run now.

  3. Conditional execution:

    • If the nested workflow returns true, continue the parent workflow.

    • If it returns false, stop the workflow.

Did this answer your question?