Agent Wealth HubFree public resources
中文 EN العربية

Turn ecommerce campaign materials into a reviewable weekly brief

Separate deterministic checks on sales CSVs from summarizing campaign notes, then combine them into a human-reviewed draft with definitions, exceptions, and open questions.

Reviewed · 2026-10-20 · Content updated · 2026-10-20

Direct answer

Use formulas to check orders, amounts, and currencies, then have a model organize campaign notes into a sourced draft. Review figures, denominators, and exceptions. Sum amounts only when currency and definitions match; list missing, duplicate, or conflicting records and pause affected conclusions.

Separate calculation from interpretation

CSV columns, amount totals, currencies, and duplicate-order checks follow explicit rules and are usually better handled by spreadsheet formulas or code. Campaign explanations, actions, and context require reading text, so a model can draft a source-linked summary. Keep the two jobs separate so the model does not recalculate business figures.

A weekly flow can be: receive approved files → check columns, dates, duplicate orders, and currencies → total figures with matching definitions → extract campaign updates from notes → create a draft with open questions → have an owner review before sharing.

Align amounts, currencies, and denominators

Before adding amounts, confirm the currency and whether refunds, tax, shipping, or order status are included. Keep currencies separate; if conversion is needed, record the rate, date, and source rather than asking a model to guess.

Impressions are a count; add-to-cart and order-conversion rates are ratios. Record each numerator, denominator, and definition. If a denominator is missing, preserve the reported value and mark its definition unconfirmed; do not compare it or infer a cause.

Keep missing, duplicate, and conflicting data in draft

Do not total a file with a missing required column. For a repeated order ID, check for duplicate export, split order, or separate purchases. Preserve both sources and timestamps when values conflict; mark for confirmation.

After correction, retest the original exception and a normal sample; confirm rerunning a duplicate file does not create a second report. An owner approves any send, write-back, or publication.

Offline example and Agent acceptance workflow

Compare the example input with the result and acceptance checks.

Input text

Fictional practice files. sales.csv: row 2 order_id=1001, amount=12.50, currency=USD; row 3 order_id=1003, amount=9.00, currency=USD. Exception file duplicates.csv: rows 2 and 3 both show order_id=1002, amount=9.00, currency=USD; whether this is a duplicate export is unconfirmed. note.txt row 1: 38,000 impressions; 8.2% add-to-cart rate; 2.1% order conversion rate; denominators not provided; page speed is being checked.

Prompt for an Agent interface you already use

Use only the supplied information. Separate figure checks, campaign summary, exceptions, and missing information. Preserve amounts, currencies, and rates; do not count the duplicate order as confirmed sales or total an unconfirmed amount. State that denominator definitions are missing and comparability cannot be confirmed. Return JSON with string values; write “not provided” for missing text. Do not guess, send, or publish.

Expected result

{
  "sales_file": "sales.csv rows 2-3; USD 12.50 + 9.00 = 21.50",
  "duplicate_file": "duplicates.csv rows 2-3; order 1002 repeated; total pending confirmation",
  "campaign_note": "note.txt row 1; 38,000 impressions; add-to-cart 8.2%; order conversion 2.1%",
  "rate_definitions": "not provided; comparability unconfirmed",
  "publication": "draft; owner review required"
}

Review checklist

Selected resources

Orchestrate a multi-step agent task as a sequential workflow

Why it is included: Split input preparation, specialist work, and final synthesis into dependent nodes that consume earlier outputs.

When it does not fit: A single local CSV check does not need a multi-stage orchestration runtime.

google/adk-python · docs/guides/workflow/workflow/index.md · 2026-10-14

Retry workflow nodes only for selected transient exceptions

Why it is included: Set attempts, backoff, and an exception allowlist for one unreliable node; do not retry business denials.

When it does not fit: Do not blindly retry validation/business rejections or non-idempotent writes.

google/adk-python · docs/guides/workflow/retry_config/index.md · 2026-10-14

Stop an agent run when the user cancels or the client disconnects

Why it is included: Pass a client cancellation signal to the Runner so long tools or workflow nodes stop and the event stream closes cleanly.

When it does not fit: A short report that finishes immediately does not need a cancellation state machine.

google/adk-python · docs/guides/runners/runner/abort.md · 2026-10-14

Pause an agent workflow to ask for missing user information

Why it is included: Emit a structured input request when a workflow lacks a decision or field, then continue after the user responds.

When it does not fit: When the CSV has all required fields and fixed rules, asking the user adds no value.

google/adk-python · docs/guides/events/request_input/index.md · 2026-10-14

Add human approval to a side-effecting agent tool

Why it is included: Pause an agent run before an external change so a person can inspect and approve the exact action.

When it does not fit: A local draft with no external send/publish action needs no approval integration.

openai/openai-agents-python · docs/human_in_the_loop.md · 2026-10-14

Use event history to trace when agent state changed

Why it is included: Use ordered session events and state deltas to explain agent state transitions instead of guessing from prompts.

When it does not fit: A one-off local run does not need persistent workflow event history.

google/adk-python · docs/guides/events/event/index.md · 2026-10-14

Sources and review dates