Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gainable.dev/llms.txt

Use this file to discover all available pages before exploring further.

What is the action log?

Every time a Autopilot agent runs, the runtime records what happened. The result is a structured, queryable log that lives in your app as the AgentAction collection. If something is in doubt, the action log is the source of truth. The log captures four things for every run:
  1. The trigger. Which playbook fired and why.
  2. The observation. What the agent looked at (records, signals, prior actions).
  3. The reasoning. What the agent decided and why.
  4. The outcome. Which tools ran, what they returned, what happened next.
This isn’t optional. The log is always on. The runtime cannot run a tool without writing to it.

Why every action is logged

  • Trust. Users approve drafts faster when they can see the full reasoning chain. Skeptics become believers when they can audit every step.
  • Debugging. When a playbook misbehaves, the log shows where the reasoning went sideways.
  • Compliance. Regulated environments need provable audit trails. The log is structured for export.
  • Graduation. Risk tier graduation uses approval rates from the log. No log, no graduation.
  • Improvement. Approval and skip patterns reveal which objectives are tuned correctly and which need editing.

Schema

The AgentAction collection is a system-managed collection in every Gainable app. You can query it through the Copilot, the dashboard, or the action log UI in Autopilot.
FieldTypeWhat it stores
idstringUnique action ID
agent_idstringThe agent that produced the action
playbook_idstringThe playbook that ran
objective_idstringThe objective the playbook was working toward
scopeenumapp_wide or personal
trigger_typeenumschedule, data_change, webhook, user_triggered
trigger_payloadjsonFull payload of the trigger
observationjsonRecords and signals the agent considered
reasoningtextHuman-readable reasoning chain
tool_callsarrayEach tool the playbook called, with inputs and outputs
outcomeenumapproved, skipped, auto_executed, rate_limited, error, pending
owner_user_idstringThe user the action’s draft was routed to
created_attimestampWhen the run began
resolved_attimestampWhen the action reached a terminal outcome
parent_action_idstringIf this action was a follow-up to another

Outcomes

OutcomeWhat it means
pendingDraft is waiting in Autopilot
approvedOwner approved; underlying tool ran
skippedOwner skipped the draft
auto_executedAction ran without approval (auto tier or auto-with-undo)
rate_limitedAction was blocked by a rate limit
errorTool call failed; reason captured in tool_calls[*].error

Querying the log

The action log is just a collection, so you can query it the same way you query anything else.

From Copilot

Ask the Copilot directly:
Show all SLA-enforcer actions from the last 7 days
where the outcome was skipped.
Which playbook produced the most rate_limited
outcomes this month?

From a dashboard

Drop a chart or table view onto a dashboard scoped to the AgentAction collection:
Add a chart to the operations dashboard showing
SLA-enforcer outcomes (approved, skipped, error)
over the last 30 days, grouped by week.

From a playbook

Yes, agents can read their own action log. This is how follow-up playbooks know what’s already been tried:
- tool: query_collection
  collection: AgentAction
  filter: "playbook_id = 'stalled_deal_chaser' AND owner_user_id = {{ deal.owner }} AND created_at > now - 7_days"
  limit: 1
If a stalled-deal playbook sees that it already drafted a nudge for this deal in the last 7 days, it can skip drafting another. Ackermann-class loops are bounded.

What gets logged for each tool

ToolLogged inputsLogged outputs
query_collectionFilter, sort, limit, fieldsRecord IDs returned, count
update_recordsFilter, set clauseIDs updated, prior values for undo
send_emailRecipient, subject, body hashProvider message ID, delivery status
send_slackChannel, message hashSlack message ID
send_smsRecipient hash, body hashProvider message ID
notify_userUser ID, title, bodyNotification ID
call_externalURL, method, body hashStatus code, response hash
ask_humanUser ID, question, optionsAnswer, response time
create_taskTask fieldsCreated task ID
draft_for_approvalUnderlying payloadDraft ID, owner
Bodies of outbound messages are hashed by default for compactness. The full content is retained on the draft itself in Autopilot until the configured retention window closes.

Retention

DataRetention
Action recordsIndefinite (or per-org configured)
Full draft bodies90 days after resolved_at (configurable)
Tool input/output payloads30 days (configurable)
Hashes and metadataSame as the action record
For regulated environments, retention can be raised to 7+ years. For consumer-facing apps with privacy obligations, retention can be tightened.

Common queries

Approval rate per playbook

Show approval rate per playbook over the last 30 days,
sorted highest to lowest.
This is the number you watch when deciding whether to graduate a playbook to a higher risk tier.

Why was this draft created?

Open the draft in Autopilot. The reasoning and observation fields render alongside the proposed action. No need to query the log directly.

What did this agent do this morning?

Show all actions from the daily-briefing agent
in the last 24 hours.

Where are skips concentrated?

Which objectives have the lowest approval rate this month?
A low approval rate means the objective is producing drafts that don’t match what users actually want. Tighten the trigger filter or revise the template.

Best practices

A dashboard with approval rate, skip reasons, and rate-limited counts is the single most useful artifact for tuning agents. Add it during the autonomy build phase.
Errors in tool_calls are usually a sign of upstream changes (renamed fields, missing API keys, deleted records). Spikes mean something broke.
When playbook B runs because playbook A’s draft was approved, link them. The thread of reasoning becomes traceable.
The runtime owns the schema. Custom apps that try to insert their own action records will fail validation. Use create_task for human-visible TODOs instead.

Learn more

Tools

What gets logged per tool

Risk tiers

How the log feeds graduation

Inbox

Where the log surfaces in the UI

Scopes

How log slicing maps to scope