Quick Start

This guide will walk you through creating your first durable workflow with kontinue. By the end, you’ll have a working workflow running in your Kubernetes cluster.

Prerequisites

  • A Kubernetes cluster (v1.30+)
  • kubectl configured to access your cluster
  • Go 1.25 or later
  • Helm 3+ to install dependencies

Installation

Add the Helm Repository

helm repo add kontinue https://gitlab.com/api/v4/projects/kontinue%2Fkontinue/packages/helm/stable
helm repo update

Install CRDs

Install the kontinue CRDs to your cluster:

helm install kontinue kontinue/kontinue --namespace kontinue

Create Your First Workflow

Let’s create a simple workflow which accepts an argument and sets the message.

Create main.go:

package main

import (
	"context"
	"flag"
	"fmt"
	"os"
	"time"

	"gitlab.com/kontinue/kontinue/pkg/function"
	"gitlab.com/kontinue/kontinue/pkg/kontinue"
	"gitlab.com/kontinue/kontinue/pkg/worker"
)

type HelloWorldArgs struct {
	Name string `json:"name" description:"The name of the person to greet" default:"World"`
}
type HelloWorldResult struct {
	Greeting string `json:"greeting"`
}

func HelloWorld(ktx *kontinue.ExecutionContext, args *HelloWorldArgs) (*HelloWorldResult, error) {
	_ = kontinue.SetMessage(ktx, "Hello "+args.Name)
	if err := kontinue.Sleep(ktx, 5 * time.Second); err != nil {
		return nil, fmt.Errorf("sleep failed: %w", err)
	}

	return &HelloWorldResult{
		Greeting: fmt.Sprintf("Hello, %s! Your execution completed successfully.", args.Name),
	}, nil
}

func main() {
	namespace := flag.String("namespace", "default", "Kubernetes namespace for this worker")
	group := flag.String("group", "default", "Worker group identifier")
	flag.Parse()

	w := worker.NewWorker()
	if err := worker.RegisterFunction(w, "hello-world", HelloWorld, &function.Options{
		Description: "Greets a user by name",
		Arguments:   function.ArgumentMetadata(&HelloWorldArgs{}),
	}); err != nil {
		fmt.Fprintf(os.Stderr, "Failed to register function: %v\n", err)
		os.Exit(1)
	}
	fmt.Printf("Starting worker in namespace %s (group: %s)...\n", *namespace, *group)
	if err := w.Run(context.TODO(), &worker.Options{
		Namespace: *namespace,
		Group:     *group,
	}); err != nil {
		fmt.Fprintf(os.Stderr, "Worker error: %v\n", err)
		os.Exit(1)
	}
}

Run the worker

go run ./main.go -namespace default -group default

Start a Workflow

Start a deployment using the CLI:

kontinue execute hello-world --interactive

Or via a Kubernetes manifest:

apiVersion: kontinue.cloud/v1alpha1
kind: Execution
metadata:
  generateName: hello-world-
spec:
  function: hello-world
  arguments:
    greeting: "Hello, world!"

Monitor Progress

Check workflow status (see the CLI):

# List executions
kontinue list # or kubectl get executions

# Show execution details
kontinue show <execution-name> # or kubectl describe <execution-name>