Skip to main content

Recipe

StackAI Agent Review

Record what a StackAI agent produced, which context it used, and whether the result needs a human review.

StackAI recipe

Record the agent result in plain language

Use this recipe after an agent, knowledge workflow, or action node has enough information to summarize the input, output, tools used, and next step.

When to use this recipe

Research summaries

An agent searches knowledge sources and prepares a summary for a teammate.

Support triage

StackAI classifies a request, drafts a response, or recommends a next action.

Policy or knowledge answers

The workflow answers a question from internal sources and should leave a reviewable record.

Human review

A person should check the answer before it is sent, published, or used for a customer-facing action.

Workflow shape

1

Input received

A user, form, API call, or workflow starts the StackAI run.

2

Knowledge checked

The agent uses configured sources, tools, or app nodes.

3

Answer generated

StackAI produces a summary, draft, classification, or recommendation.

4

Receipt created

An action/custom API-style step sends the receipt payload.

5

Review recorded

A person records whether the agent output is approved, rejected, or needs changes.

Request settings

Step
Action or Custom API-style request
Method
POST
URL
https://automationreceipts.com/api/v1/runs
Content type
application/json
Headers
Authorization and Content-Type

Headers

Authorization: Bearer aar_live_REPLACE_ME
Content-Type: application/json

Example run payload

Send this payload to POST https://automationreceipts.com/api/v1/runs. Replace example values with mapped values from StackAI when the workflow is ready.

Create StackAI agent receipt

{
  "automation_name": "StackAI Agent Review",
  "run_uid": "stackai-agent-REPLACE_WITH_RUN_ID",
  "source_type": "stackai",
  "trigger_type": "agent_run",
  "status": "needs_review",
  "risk_level": "medium",
  "input_summary": "A teammate asked the agent to summarize a policy question.",
  "output_summary": "StackAI generated an answer using the configured knowledge sources.",
  "model_used": "StackAI configured model",
  "tools_used": "StackAI workflow, knowledge base, LLM",
  "approval_required": true,
  "approval_status": "pending",
  "final_action": "Answer saved for review before sharing.",
  "events": [
    {
      "event_type": "trigger_received",
      "event_label": "Question received",
      "event_summary": "The StackAI workflow received the policy question."
    },
    {
      "event_type": "data_accessed",
      "event_label": "Knowledge checked",
      "event_summary": "The workflow searched the configured knowledge source."
    },
    {
      "event_type": "output_generated",
      "event_label": "Answer generated",
      "event_summary": "The agent generated a draft answer for review."
    },
    {
      "event_type": "approval_requested",
      "event_label": "Review requested",
      "event_summary": "The agent answer is waiting for a review outcome."
    }
  ]
}

Make run_uid unique

Map a StackAI run ID, message ID, conversation ID, timestamp, or generated UUID into run_uid. Automation Receipts rejects duplicate run_uid values within the same workspace.

Events this recipe uses

Event type Label What it records
trigger_received Question received The agent run started from a request.
data_accessed Knowledge checked The workflow searched or used configured sources.
output_generated Answer generated The agent produced the summary, answer, or recommendation.
approval_requested Review requested A person should check the agent output before it is used.

Append the final action

If the workflow continues after the receipt is created, append a timeline event using the original run_uid.

Append event request

curl -X POST "https://automationreceipts.com/api/v1/runs/stackai-agent-REPLACE_WITH_RUN_ID/events" \
  -H "Authorization: Bearer aar_live_REPLACE_ME" \
  -H "Content-Type: application/json" \
  -d '{
  "event_type": "approved",
  "event_label": "Answer approved",
  "event_summary": "The reviewed agent answer was approved for sharing."
}'

StackAI notes

Summarize sources, not documents

Record which knowledge source or tool category was used, but avoid sending full private documents or complete retrieved chunks.

Keep prompts out by default

Prompts and full model output can contain sensitive context. Send concise input and output summaries instead.

Place the action after output

Create the receipt after the agent has produced the answer and the workflow knows whether review is required.

Use review fields deliberately

Use needs_review and pending when a person should check the answer. Use completed and not_required for low-risk internal summaries.

Review and data notes

Workflow state Suggested fields
Internal answer saved for review status: "needs_review", approval_required: true, approval_status: "pending"
Low-risk summary completed status: "completed", approval_required: false, approval_status: "not_required"
Answer approved later Record the review in Automation Receipts or append an approved event when review happens elsewhere.
Answer needs edits Use approval_status: "needs_changes" and add a short review note or note event.

Send concise summaries by default. Avoid raw messages, documents, secrets, API keys, and full model payloads unless the receipt reader truly needs that information.

Troubleshooting

Problem What it usually means Fix
401 unauthorized The bearer token is missing, wrong, or revoked. Use the full active API key in the Authorization header.
409 duplicate run_uid A receipt already exists with that run ID in the workspace. Map a dynamic value into run_uid for each workflow run.
422 validation error A required field is missing or a machine value is not allowed. Check automation_name, run_uid, summaries, source_type, status, and approval_status.
Full prompt appears in receipt The action payload maps raw prompt or full context into a summary field. Map concise summaries instead of raw prompt, retrieved chunks, or full model output.
Action step cannot authenticate The Authorization header is missing or malformed. Send Authorization as Bearer plus the full active API key.

Next steps