temporal

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package temporal is the Temporal provider for OmniWorkflow. It runs the same generic interpreter as the other providers, but as deterministic Temporal workflow code: a single interpreter workflow walks the Plan wave by wave, dispatching each ready step to an activity that invokes the caller's StepExecutor, and holding gates on a Temporal signal. Callers never write workflow code themselves.

Index

Constants

View Source
const (
	DefaultTaskQueue = "omniworkflow"
)

Defaults.

Variables

This section is empty.

Functions

func InterpreterWorkflow

func InterpreterWorkflow(ctx workflow.Context, in interpreterInput) (map[string]bool, error)

InterpreterWorkflow is the generic DAG interpreter as deterministic workflow code. It returns the set of succeeded step IDs on success.

Types

type Config

type Config struct {
	// HostPort is the Temporal frontend address; empty uses the SDK default
	// (127.0.0.1:7233).
	HostPort string
	// Namespace is the Temporal namespace; empty uses "default".
	Namespace string
	// TaskQueue is the queue the interpreter workflow and step activity run on;
	// empty uses DefaultTaskQueue.
	TaskQueue string
}

Config configures a dialed Provider.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is the Temporal implementation of omniworkflow.WorkflowProvider.

func New

func New(c client.Client, taskQueue string) *Provider

New builds a Provider over an existing Temporal client. taskQueue empty uses DefaultTaskQueue.

func NewFromConfig

func NewFromConfig(cfg Config) (*Provider, error)

NewFromConfig dials a Temporal client from cfg and returns a Provider. The caller owns the client's lifecycle via Close.

func (*Provider) Cancel

func (p *Provider) Cancel(ctx context.Context, id string) error

Cancel requests cancellation of the run. Get then reports StatusCancelled.

func (*Provider) Close

func (p *Provider) Close()

Close closes the underlying Temporal client.

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, id string) (*omniworkflow.Run, error)

Get returns the current state of the run.

func (*Provider) NewWorker

func (p *Provider) NewWorker(executor omniworkflow.StepExecutor) omniworkflow.Worker

NewWorker returns a Worker that registers the interpreter workflow and the step activity (bound to executor) and polls the provider's task queue.

func (*Provider) Signal

func (p *Provider) Signal(ctx context.Context, id string, signal omniworkflow.Signal) error

Signal delivers a gate approval. The signal name must be ApproveSignal(gateID).

func (*Provider) Start

Start begins the interpreter workflow for req.Plan with workflow ID req.ID. The workflow ID is the idempotency key: starting again while a run with the same ID is open returns the existing run instead of creating a duplicate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL