Skip to main content

Let a preflight decide which events file a task

Do this when an event automation files tasks for events you don't want worked on, such as every push or every message in a channel. A preflight runs before each event files. It answers run or skip, or splits one event into several items, each filed as its own task.

Who can do this: your organization's Owners and Admins. Only event automations have a preflight; a schedule has none.

  1. In the sidebar, select Audit, then the automation's row on the Automations tab.
  2. Select the Settings tab. Preflight is the first field under When.
  3. Pick how the preflight decides:
    • None: every event files as it arrives. This is where a new automation starts.
    • Script: runs a script from the project's repository on one of the project's online nodes.
    • Model: asks a model, with your prompt.
  4. For Script, type the script's place in the repository in Script path, such as scripts/triage.py. The script reads the event and prints its answer. Hover the field's label for what it gets.
  5. For Model, write what the model should judge in Preflight prompt, such as "Skip events from bots. Run for anything that mentions a failing build." Then pick the key it is billed to in Anthropic API key.
  6. In Timeout (seconds), set how long the preflight may take before it counts as failed: 5 to 165 seconds.
  7. Select Save at the bottom of the page.
  8. When the next event arrives, open the Runs tab and read its outcome:
    • Preflight running: the preflight hasn't answered yet.
    • Filtered: the preflight skipped the event, with the reason it gave.
    • Failed: the preflight broke or ran out of time. The reason starts with "preflight failed".

A failed preflight counts toward Pause after consecutive failures, so while that is on, a broken script can pause the automation. Fix the script or prompt, then resume it as in Run, pause or change an automation.