Skip to main content
The @task decorator defines a single-turn automation. Tasks are one-shot (but can be long-running) and can be triggered by events or on a schedule (schedule.daily, schedule.weekly).
The only required argument is name. The name must be unique per workspace; changing it will create a new automation or overwrite an existing one with the same name.

Arguments

string
required
The name of the automation.
array
Environment variables that must be set before the automation can be enabled.

When to use @task vs @agent

Reach for @task first. Tasks are one-turn — they run once per trigger and finish. Use them for scheduled jobs, webhook handlers, or any automation that doesn’t need to keep talking to a user. Reach for @agent only when you need a multi-turn conversation — users continuing the thread from Slack, Linear, or the dashboard, with context carried across messages.