LabsThis feature is in Labs. Contact your account team to enable this feature.
- Investigate each Dag failure and send the root cause and a fix to Slack.
- Send a daily report of failing Dags and Deployment health to your team every morning.
- Summarize the Dag runs of the previous week for a Workspace every Monday.
- Check the Dags in a Deployment every hour and post new failures to a Slack channel.
- Read the Dag code in your GitHub repository when a Dag fails, and suggest a code fix.
How Routines work
A Routine belongs to one Workspace or one Deployment. Its trigger is one of the following:- Dag failure: One of the selected Dags in the Routine has a failed run.
- Schedule: A cron schedule starts a run.
Astro sends notifications only for completed runs. A failed, cancelled, or skipped run doesn’t send a notification. To find these runs, open the Routine’s run history.
Create a Routine
Prerequisites
- Access to Otto Routines. To request access, contact your Astronomer account team.
- The Workspace Author or higher role in the Workspace, or the Deployment Admin role for a Deployment Routine. See User permissions.
- At least one Email or Slack notification channel for the Workspace or Deployment, if you want to receive results.
Create a Routine in the Astro UI
- In the Astro UI, go to Build > Routines.
- Click New Routine.
- In What should Otto do?, select a managed Routine or click Start from scratch.
- Enter a Name. The name has a maximum of 64 characters.
- Configure the trigger. If you start from scratch, select the trigger type first. See Configure a Dag failure trigger or Configure a schedule trigger.
- In Instructions, enter what Otto does on each run. The instructions have a maximum of 20,000 characters. For a managed Routine, this field is Guidance, and it’s optional.
- In As role, select the role that each run uses. This field has no default.
- (Optional) In MCP servers, select up to 10 MCP servers that Otto can use during a run.
- (Optional) In Code access, give Otto access to your GitHub code.
- In Channels, select up to 10 Email or Slack notification channels. To add a channel, click New Notification Channel.
- (Optional) In the advanced settings, change Timeout after and the run limits. See Configure a Dag failure trigger.
- Click Create Routine.
Configure a Dag failure trigger
Select When a Dag fails, then select up to 10 entries in Dags. You can also select all Dags in a Deployment. Each failure of a matching Dag starts a run. A Dag failure Routine has two run limits that stop a failing Dag from starting too many runs:- Routine run limit: The maximum number of runs of the Routine in the limit window. The default is 50 runs in 24 hours.
- Run limit for each Dag: The maximum number of runs for one Dag in the limit window. The default is 24 runs in 24 hours. This limit can’t be more than the Routine run limit.
Configure a schedule trigger
Select On a schedule, then select the Workspace or Deployment and a Schedule. You can select one of the following:- Every hour
- Every N hours, where N is 2, 3, 4, 6, 8, or 12
- Every day
- On days of the week
- Custom cron
@daily aren’t supported. The minimum interval between two runs is 15 minutes.
The default schedule is 0 7 * * 1-5, which runs at 07:00 from Monday to Friday, in the time zone of your browser.
Managed Routines
Managed Routines are Routines with instructions that Astronomer writes and maintains. Astro doesn’t create or turn on a managed Routine for you. To use one, select it when you create a Routine.
You can’t change the trigger type of a managed Routine. To add your team’s context, enter it in Guidance. Where your guidance conflicts with the instructions from Astronomer, Otto follows your guidance.
To turn off a managed Routine, pause it or delete it the same way as any other Routine. See Monitor and manage Routines.
Monitor and manage Routines
Go to Build > Routines and click a Routine to see its run history. Click a run to see its result, steps, duration, and cost. Use the actions menu of a Routine to manage it:
To stop a run in progress, open the run and click Cancel Run.
A test run doesn’t stop at the run limits, but it counts toward them for later runs. A Routine can have a maximum of five test runs in progress at the same time.
When you delete a Workspace or a Deployment, Astro deletes its Routines.
Permissions and security
Which identity a run uses
Each run uses a single-use API token that belongs to the Astro Routine Runner system user, not to you. The token has the run-as role at the Routine’s Workspace or Deployment, so a run can do only what that role allows. You select the run-as role in As role:- Workspace Routine: Workspace Owner, Workspace Operator, Workspace Author, Workspace Member, or Workspace Accessor.
- Deployment Routine: Deployment Admin, Deployment Accessor, or a custom Deployment role.
Who can manage Routines
- A Workspace Member can view the Routines in the Workspace and their run history.
- A Workspace Author or higher can also create, edit, and delete Routines in the Workspace and its Deployments.
- A Deployment Admin can do all Routine actions for their Deployment.