Dispatch LangChain 1.0 chain/agent events to external systems — webhooks, Kafka, Redis Streams, SNS — via async fire-and-forget callbacks, subgraph-aware wiring, and HMAC-signed delivery with idempotency keys.
SkillScore95Maintained
Automatic
◆AI Engineer packsaaslangchainlanggraph
Last verified 8/31/2026
What it changes
Passed 21 of 22 test cases with the skill, and 13 of 22 without it.
Without skill59%
With skill95%
Checks it passed that the model alone missed
Uses a retry delay schedule of 1, 5, and 30 seconds.
Sets the HMAC signature header name to X-Signature-256.
Formats the idempotency key as run_id:event_type:step_index.
and 8 more in the full report
8 fixed13 passed either way1 still failing0 broke
Pass-rate lift
+36 pp
Tokens
+110%
Agent turns
0%
Response time
-34%
Model gemini-3.6-flashMeasured 8/31/2026v121 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 8 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 8
Prompt
To secure outgoing webhooks, our delivery service signs request JSON bodies using HMAC-SHA256. What standard header name and string value format should be set on the outgoing HTTP request for signature verification?
What was checked, without and with the skill
Checked
Without skill
With skill
Sets the HMAC signature header name to X-Signature-256.
Missed
Passed
Formats the signature header value with prefix sha256=.
Passed
Passed
case-08 · gemini-3.6-flash · 8/31/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md300 lines6 files
LangChain Webhooks and Event Dispatch (Python)
Overview
A team wires per-tool webhook dispatch from their LangChain agent via FastAPI
BackgroundTasks — analytics is always N seconds late because BackgroundTasks
fire after the HTTP response closes, not during the stream (P60). Worse:
the BaseCallbackHandler they attached via .with_config(callbacks=[h])
fires on the outer agent but is dark on the subagent's tool calls — custom
callbacks are not inherited by LangGraph subgraphs (P28), they must be
passed via config["callbacks"] at invoke time.
Pain-catalog anchors handled here:
P28 — Callbacks via with_config don't propagate to subgraphs
P46 — SSE streams dropped by buffering proxies (see langchain-langgraph-streaming)
P47 — astream_events(v2) emits thousands of events; never forward raw
P60 — BackgroundTasks fire post-response; wrong for per-event dispatch
This skill walks through an async AsyncCallbackHandler with fire-and-forget
dispatch, per-target sinks for HTTP / Kafka / Redis Streams / SNS, HMAC-signed
delivery with 1s/5s/30s retry and DLQ, idempotency keys = `run_id + event_type
step_index, andconfig["callbacks"]wiring that makes subagent calls visible. Typical webhook latency budget: <500ms per event. Pin:langchain-core 1.0.x, langgraph 1.0.x. Scope: server-to-server dispatch only — UI streaming is in langchain-langgraph-streaming`.