FeaturedDev & IT Ops#Python#Code#Latency#SLA#Statistics#No Credentials

Python Latency SLA Report

Normalise messy API timestamps with python-dateutil, then compute p50/p95/p99 latency and SLA breach rate in a sandboxed Code node.

Workflow at a glance

The full canvas, before you import it

Click any node to see its config.

#Python#Code#Latency#SLA#Statistics#No Credentials

Click a node to select it — same as the Heym editor; the panel shows its settings.

4 nodes · Free & source-available

Python Latency SLA Report

Turn a raw list of API events into a latency report with percentiles and an SLA breach rate. Both steps run in the Code node, so the logic is plain Python and the run is deterministic — no LLM in the loop.

What this workflow does

  1. rawEvents holds a JSON array of API calls whose timestamps arrive in four different formats
  2. normalizeEvents installs python-dateutil and parses every timestamp into sorted UTC ISO strings
  3. latencyStats uses the standard library statistics module for p50, p95, p99, mean, and standard deviation, and counts SLA breaches against a millisecond budget
  4. slaReport returns the normalised events alongside the report

Why the Code node

This is the case the Code node exists for. Percentiles and standard deviation cannot be expressed in a Set node, and mixed timestamp formats (14/08/2026 09:15, Aug 14 2026 9:19am, 2026-08-14T09:12:04Z) need a real date parser rather than a format string. Sending the rows to an LLM would be slower, cost money, and give a different answer on each run.

Each execution creates a throwaway container, installs python-dateutil into it, runs the code, and destroys it. The second node leaves requirements.txt empty, which skips installation entirely and makes it noticeably faster.

Note on network

Both Code nodes keep Allow network off, so the code itself has no egress at all. Dependency installation still reaches PyPI — that phase always has network. If you extend this to pull events from a live endpoint, use an HTTP node and pass the body in through Parameters rather than enabling network on the Code node.

Use cases

  • Weekly latency review for an API or a background worker
  • SLA breach reporting against a millisecond budget
  • Any numeric summary that Set cannot express: percentiles, deviation, weighted scoring

How to import this template

  1. 1Click Import → Copy JSON on this page.
  2. 2Open your Heym and navigate to a workflow canvas.
  3. 3PressCmd+V/Ctrl+V— nodes appear instantly.
  4. 4Add your API keys in the node config panels and click Run.
More workflow templates
View all templates
Heym
incident analysis · production AI
Observed across 100s of AI rollouts

AI workflows don't fail because of prompts.
They fail because of orchestration.

symptom · glue code01
5 tools
Scripts, vector DB, approval bot, tracing, browser runner — none of them talk.
symptom · visibility02
~0%
Observable behavior across the stack. Debugging is guesswork.
with heym · one runtime
1 canvas
Agents, RAG, HITL, MCP, traces & evals. Self-hosted. Observable.
AI-Native RuntimeProduction-Grade
github.com/heymrun/heym