Documentation Index
Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt
Use this file to discover all available pages before exploring further.
What are Automations?
Automations let you trigger AI coding agents automatically in response to events:- GitHub: New issues, PR reviews, CI failures, commits
- Linear: Issue status changes, new bugs, sprint planning
- Slack: @1code mentions in channels
- Git events: Push, merge, tag creation
- Manual: Trigger on-demand from the UI or API
- Auto-reviewing pull requests
- Fixing CI failures overnight
- Triaging incoming bugs
- Keeping documentation in sync
- Automated dependency updates
Automations require a Pro or Max subscription. Learn more at 1code.dev/agents/async.
How Automations Work
Condition check
1Code evaluates your conditions:
- Labels match filter
- Title contains keywords
- Author meets criteria
- Custom logic matches
Agent launch
If conditions match, 1Code:
- Spins up a background agent
- Clones the repository
- Passes context from the trigger event
- Starts executing the automation task
Work execution
Agent works autonomously:
- Analyzes the issue/PR
- Makes code changes
- Runs tests
- Commits and pushes
- Comments on the issue/PR
Creating Your First Automation
Choose a template
Start with a pre-built template:Popular templates:
- PR Reviewer: Review pull requests automatically
- CI Fixer: Fix failing test suites
- Bug Triager: Analyze and categorize new bugs
- Dependency Updater: Keep dependencies current
- Docs Sync: Update docs when code changes
Configure trigger
Select what event starts the automation:GitHub triggers:
- Issues opened
- Issues labeled
- Pull request opened
- Pull request review requested
- Check suite failed
- Push to branch
- Issue created
- Issue status changed
- Issue assigned
- Cycle started
- @1code mentioned
- Keyword in channel
Write instructions
Tell the agent what to do:Good automation prompts:
- “Review this PR for security issues, code quality, and test coverage. Leave detailed comments on specific lines that need improvement.”
- “The CI failed on this commit. Analyze the error logs, fix the issue, and ensure all tests pass before pushing.”
- “This bug report describes a crash. Reproduce it, find the root cause, and implement a fix with tests.”
{{issue.title}}- Issue title{{issue.body}}- Issue description{{pr.number}}- PR number{{pr.files}}- Changed files{{author.username}}- Who triggered it
Choose agent and model
Select which AI to use:
- Claude Code: Best for complex reviews and refactoring
- Codex: Faster for targeted fixes
Set behavior options
Configure how the agent works:Silent mode: Don’t comment until done (avoid spam)
Auto-commit: Commit changes automatically
Create PR: Open PR instead of pushing to branch
Run tests: Always run test suite before finishing
Notify on: Success, failure, or both
Automation Templates
Auto PR Reviewer
Reviews pull requests and leaves inline comments: Trigger: Pull request opened OR review requested Conditions:CI Failure Fixer
Automatically fixes failing CI builds: Trigger: Check suite failed Conditions:Bug Triager
Analyzes and categorizes new bug reports: Trigger: GitHub issue opened Conditions:Dependency Updater
Keeps dependencies up-to-date weekly: Trigger: Manual + Scheduled (weekly) Conditions: None (always runs) Instructions:Docs Sync
Updates documentation when code changes: Trigger: Push to main branch Conditions:Connecting Integrations
GitHub
Authorize 1Code
Grant permissions:
- Read repository contents
- Read and write issues
- Read and write pull requests
- Read checks
- Receive webhooks
Select repositories
Choose which repositories can trigger automations:
- All repositories
- Only select repositories
Linear
Authorize access
Grant 1Code permission to:
- Read issues
- Update issue status
- Write comments
- Receive webhooks
Slack
Managing Automations
Viewing Automation History
See all past executions:- Go to Automations page
- Click on an automation
- View Execution Timeline:
- When it ran
- What triggered it
- Success/failure status
- Link to the agent chat
- Time taken
- Resources used
Pausing Automations
Temporarily disable without deleting:- Find automation in list
- Toggle Enabled switch off
- No new executions will trigger
- Re-enable anytime
- During maintenance windows
- When costs are high
- To debug issues
- Seasonal automation (e.g., only during sprints)
Editing Automations
Update existing automations:- Click automation name
- Click Edit
- Modify triggers, conditions, or instructions
- Click Save
- Changes take effect immediately
Deleting Automations
- Click three-dot menu
- Select Delete
- Confirm deletion
- Webhooks are removed automatically
Advanced Configuration
Custom Condition Logic
Use JavaScript expressions for complex conditions:issue: GitHub issue objectpr: Pull request objectcommit: Commit objectfiles: Array of changed fileslabels: Array of label namesauthor: User who triggeredbaseBranch,headBranch: Branch namesadditions,deletions: Line counts
Template Variables
Inject event data into prompts:Chaining Automations
Trigger automations from other automations:Rate Limiting
Prevent runaway costs: Per automation:- Max executions per hour: 10
- Max executions per day: 50
- Max concurrent runs: 3
- Pro: 100 executions/day
- Max: 500 executions/day
Best Practices
Specific Conditions
Use tight filters to avoid triggering on every event. Narrow by labels, branches, or keywords.
Silent Mode
Enable silent mode for automations that run frequently to avoid comment spam.
Test First
Always test automations manually before enabling automatic triggers.
Monitor Costs
Check execution history regularly to ensure automations aren’t running more than expected.
Descriptive Names
Name automations clearly: “PR Reviewer (security)” not “Automation 1”.
Version Control
Export automation configs and commit to your repo for team collaboration.
Troubleshooting
Automation not triggering
Automation not triggering
Check:
- Automation is enabled (toggle switch is on)
- Conditions are being met (test with manual trigger)
- Webhook is properly connected (check integration settings)
- Rate limits haven’t been exceeded
- Repository is included in GitHub app installation
Triggering too often
Triggering too often
Solution: Refine conditions to be more specific:
Agent is confused by event context
Agent is confused by event context
Solution: Improve prompt to explain the context:
Webhook delivery failed
Webhook delivery failed
Cause: 1Code couldn’t receive the webhook from GitHub/Linear/Slack.Solution:
- Check webhook settings in the platform (GitHub Settings > Webhooks)
- Verify webhook URL is correct:
https://1code.dev/webhooks/v1/[provider] - Re-authenticate integration in 1Code settings
- Check webhook delivery history for error details
Exceeded rate limits
Exceeded rate limits
Solution:
- Increase rate limits in automation settings
- Upgrade to Max plan for higher limits
- Refine conditions to reduce unnecessary triggers
- Use manual triggers for high-volume automations
Next Steps
Background Agents
Learn how automations use background agents to run independently.
API Access
Trigger automations programmatically via the 1Code API.
MCP Servers
Connect external tools that automations can use.
Webhooks
Create custom webhooks for your own services.