workflow

package
v0.1.0-preview Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package workflow is the resource module for the node-local Workflow orchestration service — the n8n-style visual workflow engine that executes ReactFlow DAGs in parallel waves.

A workflow is a node graph (definition); an execution is one run of it.

Endpoints (all on the per-tenant node):

GET    /api/v2/workflow/workflows
POST   /api/v2/workflow/workflows
GET    /api/v2/workflow/workflows/{id}
DELETE /api/v2/workflow/workflows/{id}
POST   /api/v2/workflow/save
POST   /api/v2/workflow/publish
POST   /api/v2/workflow/validate
POST   /api/v2/workflow/execute
POST   /api/v2/workflow/test-node
GET    /api/v2/workflow/executions
GET    /api/v2/workflow/executions/{id}
POST   /api/v2/workflow/executions/{id}/cancel
DELETE /api/v2/workflow/executions/{id}
POST   /api/v2/workflow/export/{json|yaml}
GET    /api/v2/workflow/health

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	T       *transport.Transport
	NodeURL string
}

Client is the entry point. Construct via c.Workflow().

func (*Client) CancelExecution

func (c *Client) CancelExecution(ctx context.Context, executionID string) (Result, error)

CancelExecution cancels a running execution.

func (*Client) Create

func (c *Client) Create(ctx context.Context, definition map[string]interface{}) (Result, error)

Create creates a new workflow from a node-graph definition.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, workflowID string) (Result, error)

Delete deletes a workflow definition.

func (*Client) DeleteExecution

func (c *Client) DeleteExecution(ctx context.Context, executionID string) (Result, error)

DeleteExecution deletes an execution record.

func (*Client) Execute

func (c *Client) Execute(ctx context.Context, payload map[string]interface{}) (Result, error)

Execute runs a workflow. payload is either a full definition or {"workflow_id": "…"} to run a saved workflow.

func (*Client) Export

func (c *Client) Export(ctx context.Context, definition map[string]interface{}, format string) (Result, error)

Export serializes a workflow as "json" or "yaml".

func (*Client) Get

func (c *Client) Get(ctx context.Context, workflowID string) (Result, error)

Get returns one workflow definition.

func (*Client) GetExecution

func (c *Client) GetExecution(ctx context.Context, executionID string) (Result, error)

GetExecution returns one execution record.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (Result, error)

Health is a liveness probe for the workflow service.

func (*Client) List

func (c *Client) List(ctx context.Context) (Result, error)

List returns all saved workflows.

func (*Client) ListExecutions

func (c *Client) ListExecutions(ctx context.Context) (Result, error)

ListExecutions returns all workflow executions.

func (*Client) Publish

func (c *Client) Publish(ctx context.Context, definition map[string]interface{}) (Result, error)

Publish publishes a workflow.

func (*Client) Save

func (c *Client) Save(ctx context.Context, definition map[string]interface{}) (Result, error)

Save upserts a workflow definition.

func (*Client) TestNode

func (c *Client) TestNode(ctx context.Context, payload map[string]interface{}) (Result, error)

TestNode runs a single node in isolation.

func (*Client) Validate

func (c *Client) Validate(ctx context.Context, definition map[string]interface{}) (Result, error)

Validate checks a workflow graph without running it.

type Result

type Result = map[string]interface{}

Result is a decoded JSON object response.

Jump to

Keyboard shortcuts

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