Add Trigger
add_triggerYou MUST call get_skill_guide('trigger_code') before writing the trigger's
code — the qualification rules, sandbox globals, tool surface, and out
contract live in the skill. New code runs on the trigger's next firing.
The same goal-sync obligation update_trigger carries applies to creating
one: a new scheduled trigger adds recurring behavior the goal doesn't yet
describe, and the goal is injected into every turn on this agent. After this
call, name what the new trigger does and how often via
update_agent(agent_id=..., goal=...) in the same turn. A flow's per-node
on_enter triggers are already covered by the goal's sequence description
and need no separate mention.
To add a flow node's on_enter enactment — a terminal hook, or re-arming a
node whose row was removed — pass an on_enter trigger with the target
node_id (any node kind; the node must already exist in the sequence). One
on_enter per node — if it already has one, edit that with update_trigger
instead of adding a second. On a send or connection-request node, that trigger's prompt
holds only extra instructions; the message or note itself goes in the node's
message_templates (update_node).
Dict with success, agent_id, trigger_id, next_run_at, and the added trigger's
full dict under trigger, plus a warning when the agent is paused, since its
triggers don't fire until it is set back to active. Read the agent's
other triggers via get_agent_details.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trigger | Yes | The trigger to add. In its 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. | |
| agent_id | Yes | ID of the agent to add the trigger to |