New to Kestra?
Use blueprints to kickstart your first workflows.
Push a Faktory canary job over FWP and verify it via the Web UI stats endpoint, alerting Slack if the two subsystems disagree.
A Faktory server exposes two independent subsystems: the raw Faktory
Work Protocol (FWP) TCP port that real workers and job producers
depend on, and a separate Web UI HTTP port used for dashboards and
monitoring. Checking only one - as this repository's existing Faktory
blueprint does, which polls just the Web UI /stats endpoint - can
miss a failure in the other. This blueprint pushes a synthetic canary
job over the real FWP enqueue path and cross-checks it against the
Web UI's own reporting, catching the moment either subsystem breaks
or the two fall out of sync with each other.
periodic_enqueue_check (io.kestra.plugin.core.trigger.Schedule) runs every 15 minutes, explicitly passing faktory_host, faktory_port, faktory_web_stats_url, and canary_queue through its own inputs: block so the flow is self-contained when the trigger fires. Shipped disabled so a manual run can be verified first.probe_push_canary_job (io.kestra.plugin.faktory.Push) pushes a synthetic job over the raw FWP TCP socket to a dedicated, worker-free canary queue, capturing the returned job id (jid).probe_fetch_stats (io.kestra.plugin.core.http.Request) reads the Web UI's /stats endpoint - a completely separate HTTP subsystem - and captures the raw JSON response body.evaluate_enqueue_reachability (io.kestra.plugin.core.flow.If) branches on whether the canary queue's reported depth (parsed from the stats response with jq) is greater than zero.then (HEALTHY): log_enqueue_healthy records the pass with the canary job id.else (ENQUEUE_PATH_UNHEALTHY): alert_enqueue_unhealthy reports the mismatch to Slack.log_audit_complete always runs last, printing the canary job id and queue regardless of which branch fired.errors block alerts Slack separately if either probe fails outright - an unreachable FWP port or an unreachable Web UI.HEALTHY there, but is caught here.io.kestra.plugin.faktory.Push, a real task class with zero prior usage anywhere in this repository's blueprints, combined with the plugin's documented /stats JSON schema (faktory.queues, verified directly from Faktory's own Go source) parsed via jq on a raw HTTP response body - the officially documented pattern for this exact situation, per Kestra's own HTTP request documentation.retries: -1 discards it immediately in the unlikely case something does pick it up).Push used for synthetic monitoring rather than real job submission.Faktory's own Web UI has no built-in cross-check between its FWP and HTTP subsystems, and no Slack integration of its own. Kestra supplies the schedule, the HEALTHY/ENQUEUE_PATH_UNHEALTHY classification as a first-class branch, and an execution history showing exactly when the two subsystems first disagreed.
7419) and its Web UI port (default 7420). Faktory publishes an official open-source Docker image requiring no account or license - docker run --rm -p 7419:7419 -p 7420:7420 contribsys/faktory:latest starts a local instance for testing.canary_queue).FAKTORY_PASSWORD: password for io.kestra.plugin.faktory.Push, matching the plugin's own documented password connection property. Leave the secret empty for an unauthenticated local Faktory instance.SLACK_WEBHOOK_URL: Slack incoming webhook used by alert_enqueue_unhealthy and the errors block.SECRET_, base64-encoded - for example SECRET_FAKTORY_PASSWORD=$(echo -n '<your-password>' | base64) - and read back in flows with {{ secret('NAME') }}.faktory_host (STRING, default localhost): Faktory server host for the FWP connection.faktory_port (INT, default 7419): FWP TCP port.faktory_web_stats_url (STRING, default http://localhost:7420/stats): Web UI stats endpoint, a separate port and protocol.canary_queue (STRING, default kestra-canary-queue): the dedicated, worker-free queue the canary job is pushed to.outputs.probe_push_canary_job.jid (String): the Faktory job id of the pushed canary (verified field from Push's own Output class).outputs.probe_fetch_stats.body (String): the raw /stats JSON response, parsed with jq for the faktory.queues map.docker run --rm -p 7419:7419 -p 7420:7420 contribsys/faktory:latest) or point this at a real one.SLACK_WEBHOOK_URL secret (and FAKTORY_PASSWORD if the server requires authentication).log_enqueue_healthy fires, with the pushed jid visible in the Faktory Web UI's queue list for canary_queue.faktory_web_stats_url at an unreachable address and re-run to confirm the errors block fires, distinct from the ENQUEUE_PATH_UNHEALTHY branch.periodic_enqueue_check once you trust the check against your real Faktory server.canary_queue values (one per priority tier your real queues use) to verify the enqueue path separately for each, catching a tier-specific FWP routing issue.total_enqueued trend check using the same /stats response (also verified from Faktory's own DataSnapshot struct) to catch a server-wide enqueue slowdown, not just a per-queue one.errors block fires (infrastructure-down) versus when ENQUEUE_PATH_UNHEALTHY fires (subsystem desync) - the two failure modes likely need different responders.canary_queue must never be a queue a real worker also consumes - if a worker picks up the synthetic KestraCanaryHeartbeat job type and doesn't recognize it, retries: -1 ensures it is discarded immediately rather than retried indefinitely, but this sentinel is designed around the queue having no consumer at all./stats body is a raw string, not pre-parsed JSON - verified directly from Kestra's own HTTP request documentation ("the expression returns a string, not a JSON"), which is why jq is used here rather than direct dot-notation field access.canary_queue - queue depth only grows across repeated runs unless something clears it periodically; this is expected and does not indicate a problem, but a very long-running deployment may want an occasional manual purge of the canary queue.Push task's properties, the /stats JSON schema (faktory.queues, total_enqueued, etc.), and the FWP/Web-UI port distinction are all taken verbatim from the Kestra plugin's own source and Faktory's own Go server source - but no Kestra engine was run to execute this flow end to end.