Executions
An Execution is a running instance of a Function. When you invoke a Function, kontinue creates an Execution resource that tracks the workflow’s progress and stores its durable state so it can be resumed after failures.
Each Execution is a Kubernetes custom resource that persists the function’s state, child references, and intermediate results. If a worker crashes or is restarted, the Execution status allows the worker (or a new worker) to pick up from the last known state.
Creating an Execution
There are several ways to create an Execution:
Using the CLI
kontinue execute hello-world --interactive
Using a Kubernetes manifest
apiVersion: kontinue.cloud/v1alpha1
kind: Execution
metadata:
generateName: hello-world-
spec:
function: hello-world
arguments:
name: "Alice"
Apply with:
kubectl create -f execution.yaml
Using the kontinue SDK
exec, err := cli.SpawnExecute(ctx, "hello-world", &HelloWorldArgs{
Name: "Alice",
}, &client.SpawnOptions{})
Execution Phases
An Execution progresses through several phases during its lifecycle:
| Phase | Description |
|---|---|
Pending | Execution created, waiting for a worker to pick it up |
Executing | A worker is actively running the function |
Suspended | Execution is waiting on a child resource (sub-execution, job, or suspension) |
Backoff | Execution failed and is waiting before retry |
Completed | Function returned successfully |
Failed | Function returned an error (after exhausting retries) |
Canceled | Execution was externally cancelled (e.g. via API) |
Execution Spec
The spec defines what function to run and how:
spec:
function: deploy-cluster # Required: name of the registered function
arguments: # Optional: input arguments passed to the function
environment: production
replicas: 3
retry: # Optional: retry configuration
retries: 3 # Number of retry attempts (default: 0)
backoff: 10s # Wait time between retries (default: 5s)
childPolicy: RetryFailed # How to handle children on retry
timeout: # Optional: timeout configuration
overall: 1h # Max total time across all attempts
attempt: 15m # Max time per attempt
ttl: # Optional: cleanup configuration
deleteAfter: 24h # Auto-delete after completion
Execution Status
The status field tracks the current state:
status:
phase: Executing
message: "Deploying to production cluster"
workerName: worker-abc123
startedAt: "2025-01-15T10:30:00Z"
attempts:
- phase: Failed
message: "connection timeout"
startedAt: "2025-01-15T10:25:00Z"
finishedAt: "2025-01-15T10:26:00Z"
- phase: Executing
startedAt: "2025-01-15T10:30:00Z"
progress:
current: 2
max: 5
Monitoring Executions
List all executions:
kontinue list
# or
kubectl get executions
Get execution details:
kontinue show <execution-name>
# or
kubectl describe execution <execution-name>