Trigger icon
Wait icon
SlackIncomingWebhook icon

Start a Temporal Workflow and Wait for Completion from Kestra

Start a Temporal workflow from Kestra, wait for its terminal state, and post the status to Slack. One audit trail across scheduling and business logic.

Categories
Infrastructure

Temporal is where durable business logic lives; Kestra is where everything around it gets orchestrated. This blueprint is the core handshake between the two layers: io.kestra.plugin.temporal.workflow.Trigger starts an OrderProcessing workflow on the orders task queue, io.kestra.plugin.temporal.workflow.Wait blocks until the run reaches a terminal state, and Slack receives the completion status. The Temporal workers keep owning retries, timers, and activity logic; Kestra owns the scheduling, the data plumbing before and after, and a single audit trail that spans both.

How it works

  1. start_workflow (io.kestra.plugin.temporal.workflow.Trigger) connects to the Temporal frontend from TEMPORAL_ENDPOINT and starts OrderProcessing on the orders task queue, passing the order ID as a JSON-encoded argument through input. The workflow ID is templated from the order ID, so retrying the Kestra execution never spawns a duplicate workflow. The task returns the documented workflowId and runId outputs.
  2. wait_for_completion (io.kestra.plugin.temporal.workflow.Wait) targets that exact run via {{ outputs.start_workflow.workflowId }} and {{ outputs.start_workflow.runId }}, polling every 10 seconds for up to 30 minutes. With failOnNonCompleted: true, a FAILED, CANCELED, TERMINATED, or TIMED_OUT workflow fails the Kestra execution too.
  3. notify posts the documented status output to Slack alongside the workflow ID, so the completion is visible where the team already looks.
  4. The errors block posts a distinct Slack alert naming the order when either the start or the wait fails.

What you get

  • A single Kestra execution that carries the start, the wait, and the notification for one business workflow run.
  • Idempotent starts by construction, because the workflow ID is derived from the order ID.
  • The workflow's terminal status and JSON-encoded result available as task outputs for downstream tasks.
  • A failure path that distinguishes a workflow that never started from one that ended badly.

Who it's for

  • Platform teams running business logic on Temporal who want scheduling, upstream data preparation, and notifications handled outside the workers.
  • Engineers who need Temporal workflow completions to gate downstream data pipelines in Kestra.
  • Teams consolidating operational visibility, so one execution history covers both orchestration layers.

Why orchestrate this with Kestra

Temporal makes the workflow itself durable, but something still has to decide when to start it, feed it the right input, wait for the answer, and tell people what happened. Kestra sits above the workers and provides exactly that: declarative inputs, secrets management for the endpoint, output passing from start to wait to notification, and an execution history where the whole round trip is auditable in one place.

Prerequisites

  • A reachable Temporal frontend and a worker polling the orders task queue with an OrderProcessing workflow registered.
  • A Slack incoming webhook for notifications.
  • For Temporal Cloud, set the task's apiKey property; for mTLS clusters, provide caCert, clientCert, and clientKey.

Secrets

  • TEMPORAL_ENDPOINT: Temporal frontend address in host:port format, for example temporal.example.com:7233.
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL.

Quick start

  1. Add the two secrets to your Kestra namespace.
  2. Rename workflowType and taskQueue to match a workflow your workers actually register.
  3. Execute the flow with an order ID and watch the Slack message report the terminal status.

How to extend

  • Parse the workflow's JSON-encoded result output with Pebble's jq filter and branch on it with downstream tasks.
  • Put this flow behind a Kestra Schedule or a file-arrival trigger so business workflows start from real events.
  • Broadcast operational signals to running workflows, as shown in the Temporal signal broadcast blueprint.
  • Enforce a completion SLA on long-running workflows, as shown in the Temporal stuck workflow guard blueprint.

Links

Orchestrate with Kestra
Orchestrate Slack with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.