Run an automation
Changed on[!NOTE] This endpoint is in public preview and is subject to change.
Runs an automation in a repository. Set event to manual and optionally include context of up to 10,000 characters, which will be injected into the automation's prompt.
The repository must have the "Allow automations" setting enabled, and the automation must be a personal automation belonging to you or a shared automation.
GitHub App installation access tokens can run shared automations. The installation must belong to the repository owner and the token must have "Agent tasks" repository permissions (write). Personal automations require a user token.
A successful response accepts the run request and includes a preallocated task_id, which can be fetched with the "Get a task by repo" Agent tasks API. It does not confirm execution or task creation. Task creation is asynchronous, so fetching the task immediately may return 404 Not Found, and downstream skips or failures can prevent its creation.
To call this endpoint, you must have write access to the repository.
OAuth app tokens and personal access tokens (classic) need:
- the repo scope for private or internal repositories
- the repo scope or public_repo scope for public repositories
Fine-grained access tokens for "Run an automation"
This endpoint works with the following fine-grained token types:
- GitHub App user access tokens
- GitHub App installation access tokens
- Fine-grained personal access tokens
The fine-grained token must have the following permission set:
- "Agent tasks" repository permissions (write)
Request
- Base URLhttps://api.github.com
- URLhttps://api.github.com/agents/repos/{owner}/{repo}/automations/{automation_id}/tasks
- Authnone declared
Path parameters
The account owner of the repository. The name is not case sensitive.
The name of the repository. The name is not case sensitive.
The unique identifier of the automation.
Request body
Response
Automation run request accepted for asynchronous processing
Changes
- info
endpoint added
- info