Skip to main content

Otto Automations

Otto Automations combine Otto's AI capabilities with Ascend's Automations to create intelligent, event-driven workflows that automatically respond to Flow events, analyze data patterns, and take actions across various platforms and services.

This guide demonstrates how to create Otto Automations using Slack notifications. That said, the patterns shown here can be adapted for many different use cases including database operations, file management, API integrations, and more.

preview feature

We're still working on this one! Expect changes and note that standard SLAs don't apply, so don't rely on this for production workloads yet. Refer to our release stages to learn more.

Prerequisites​

Before setting up the Slack Otto Automations, ensure you have:

Organization​

Otto Automations follow a consistent organizational pattern within your Ascend Project. They require three types of configuration files in specific sub-folders:

  • otto/mcp.yaml - Configures MCP server connections for external services
  • otto/otto.yaml - Configures Otto agents and grants them access to MCP servers
  • automations/<automation-name>.yaml - Defines the Automation trigger and Otto prompt
folder

Configuration​

Set up Slack MCP server​

Configure the Slack MCP server connection. For general MCP setup details, see the MCP setup guide.

otto/mcp.yaml
mcpServers:
slack:
command: npx
args:
- --cache
- /tmp/npm-cache
- -y
- "@zencoderai/slack-mcp-server"
env:
SLACK_BOT_TOKEN: ${vaults.environment.SLACK_APP_TOKEN}
SLACK_TEAM_ID: ${vaults.environment.SLACK_TEAM_ID}
SLACK_CHANNEL_IDS: ${vaults.environment.SLACK_CHANNEL_ID}

Slack-specific configuration:

  • @zencoderai/slack-mcp-server - Slack MCP functionality
  • SLACK_BOT_TOKEN - Your Slack bot's authentication token
  • SLACK_TEAM_ID - Your Slack workspace identifier
  • SLACK_CHANNEL_IDS - Comma-separated list of channel IDs where Otto can post

Configure Otto Agents​

Grant your Otto Agents access to the Slack MCP server. For detailed configuration options, see the Otto configuration guide.

otto/otto.yaml
otto:
agents:
"Otto Chat":
mcp_servers:
- slack

Create Automation​

The otto-notifications.yaml file defines when and how Otto sends Slack notifications using the run_otto Automation pattern:

automations/otto-notifications.yaml
automation:
name: otto-notifications
enabled: true
triggers:
events:
- sql_filter: json_extract_string(event, '$.data.flow') = 'transform-demo'
types:
- FlowRunError
- FlowRunSuccess

actions:
- type: run_otto
name: run-otto
config:
prompt: >-
# Instructions

You are being invoked at the end of a flow run. Your job is to assess
changes in flow run behavior, and send a Slack message to keep other users updated.
You cannot ask for help or clarification; you must do this end-to-end on your own based
on your own judgement. Your last action should always be to post a message to Slack.

## Flow run analysis rules

Analyze flow success / failure by fetching the maximum number of flow runs.

1) If the flow run was a success and the previous flow run was also a
success, send a
funny message congratulating the team on another smooth run.

2) If the flow run was a success and the previous flow run was not,
send an exciting
and congratulatory messages celebrating the flow is now fixed, and congratulating
whichever user did the fixing (check git history).

3) If the flow run was a failure and the previous flow run was also a
failure, send a sad
message imploring somebody to fix it.

4) If the flow run was a failure and the previous flow run was not,
send a big alert message.
You should try to identify who broke the flow, and even @ mention them if you can. You
should also try to analyze the changes and suggest fixes if possible.

Additionally, you should make heavy use of git history and file reading calls to help track
down details that may be relevant.

## Slack message and notification

At the end of your analysis, you must post a message to Slack in the appropriate channel.

Your slack post message should:
- include a link to the flow run:
https://[runtime.link_url]/flows/[flow_name]/[run_name]
- be formatted for Slack rendering, which is different than markdown
- when @ mentioning users, look up their profile so you can reference their actual id
note

This configuration uses a run_otto Automation type, whereas the more specialized Otto email summaries use the activity_summary Automation type.

Automation details:

  • Event trigger: The Automation monitors for FlowRunError or FlowRunSuccess events from your specified Flow
  • Otto analysis: When triggered, Otto analyzes the Flow run history and determines the appropriate response
  • Intelligent messaging: Otto crafts contextual messages based on Flow patterns:
    • Success after success: Celebratory messages for consistent performance
    • Success after failure: Congratulatory messages highlighting the fix
    • Failure after success: Alert messages identifying potential causes
    • Failure after failure: Urgent messages requesting immediate attention
  • Slack delivery: Otto posts the formatted message to your configured Slack channel
note

Otto Automations work for manual Flow runs in Deployments, but they're most powerful when combined with scheduled Automations.

For example, when testing a new production pipeline, you can create an Automation to run it every hour, then configure Otto Slack alerts to keep your team updated on progress.

Next steps​

After setting up the Slack Otto Automation:

  • Test the configuration by triggering a Flow run in your Deployment
  • Monitor Slack channels for Otto's messages
  • Adjust the prompt and triggers based on your team's needs
  • Configure additional MCP servers using the MCP setup guide
  • Explore additional Otto capabilities for enhanced automation