Create Agent
create_agentCreate a background agent that runs automatically based on triggers.
Do NOT create a new agent for follow-ups, event handlers, or scheduled checks
that continue an existing agent's work — use add_trigger on that agent instead.
When the agent matches one of the built-in agent templates — the template_id
enum lists them — set its template_id and seed workspace.inputs per that
agent's skill guide. The template_id runs the template's setup; seed a
template's inputs without it and the agent is not fully wired up. If no template
fits, omit template_id and the agent runs as a general background agent.
You MUST call get_skill_guide('trigger_code') before writing any trigger's
code — the qualification rules, sandbox globals, tool surface, and out
contract live in the skill. code runs on the trigger's next firing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | Yes | Complete instructions for what the agent should accomplish. Write as if instructing another assistant. Name any outside resource a run reads (a Google Sheet, doc, file, URL) by the identifier its tool takes (the spreadsheet ID and tab, the URL), not only by its title — a later run doesn't see this chat. | |
| title | Yes | Short name for the agent (e.g. "Outreach to Q2 leads", "Email triage") | |
| triggers | Yes | List of triggers that determine when the agent runs. An agent can have multiple triggers of different types (e.g. one schedule plus one event handler) — they fire independently. At least one trigger is required. In each trigger's prompt, name any outside resource a run reads (a Google Sheet, doc, file, URL) by the identifier its tool takes (the spreadsheet ID and tab, the URL), not only by its title — a later run doesn't see this chat. | |
| workspace | No | Optional `{'inputs': {...}, 'outputs': {...}}` dict that seeds the agent's workspace. Name any outside resource a run reads (a Google Sheet, doc, file, URL) by the identifier its tool takes (the spreadsheet ID and tab, the URL), not only by its title — a later run doesn't see this chat. | |
| template_id | No | Optional template ID. |