Library / Monitoring, Ops & Incidents
Monitoring, Ops & Incidents
Trace simulated card charges with OpenTelemetry and Jaeger
When an API call/webhook arrives, it monitors systems.
What it does
## Trace a simulated charge workflow with OpenTelemetry and Jaeger ### Quick overview This workflow simulates a card charge so you can send n8n's OpenTelemetry spans to a local Jaeger collector and compare a successful run with a deliberate failure. It needs no LLM credential and calls no payment provider. It is the Exercise 3 template from the n8n Production AI Playbook post on Audit & Trace. OpenTelemetry tracing in n8n is in Preview. ### How it works 1. Receives a POST webhook request with a requestId and amount. 2. Validate Amount (If) sends invalid amounts to Reject Request (Stop and Error). 3. Normalize Request (Edit Fields) converts the amount to cents. 4. Charge Card (If) routes requests with trigger_failure to Decline Charge, a Stop and Error node that fails with card_declined. 5. Capture Charge records the successful charge and Respond returns it. ### Setup 1. Run Jaeger locally (image jaegertracing/jaeger:2.20.0 with ports 16686 and 4318) and expose port 4318 with cloudflared tunnel --url http://localhost:4318. 2. As an instance owner or admin, open Settings > OpenTelemetry, enter the tunnel URL as the OTLP endpoint, set the sample rate to 1, turn off Track published workflows only, and enable tracing. 3. Select Execute workflow and POST {"requestId":"REQ-3001","amount":49.99}, then {"requestId":"REQ-3002","amount":49.99,"trigger_failure":true}. 4. In Jaeger, search the tag n8n.execution.id with each execution ID and inspect the spans.
The steps
- Webhook - Charge Request
- Respond
- Validate Amount
- Reject Request
- Normalize Request
- Charge Card
- Decline Charge
- Capture Charge
Similar automations
AI Agents & AssistantsTrace refund approval flows with OpenRouter and OpenTelemetry10 stepsFinance, Invoices & AccountingCheck foreign card charges against daily FX rates with Google Sheets and Slack16 stepsFinance, Invoices & AccountingRead Gmail receipt PDFs with Claude and match card statements in Google Sheets21 stepsTasks & Project ManagementCreate a New Card in Trello2 steps