Go SDKFeature Clients

Runs Client

Accessed via client.Runs() on the Hatchet client.

RunsClient

RunsClient provides methods for interacting with workflow runs

Methods:

NameDescription
BranchDurableTaskBranchDurableTask creates a branch from a durable task at the specified node.
CancelCancel requests cancellation of a specific task within a workflow run.
GetGet retrieves a workflow run by its ID.
GetDetailsGetDetails retrieves detailed information about a workflow run via gRPC, including task-level output, errors, and status.
GetStatusGetStatus retrieves the status of a workflow run by its ID.
ListList retrieves a collection of workflow runs based on the provided parameters.
ReplayReplay requests a task to be replayed within a workflow run.
RestoreRestore re-enqueues an evicted task so it can resume execution.
SubscribeToStreamSubscribeToStream subscribes to streaming events for a specific workflow run.

Functions

BranchDurableTask

BranchDurableTask creates a branch from a durable task at the specified node.

func (r *RunsClient) BranchDurableTask(ctx context.Context, taskExternalId string, nodeId, branchId int64) (*rest.V1BranchDurableTaskResponse, error)

Parameters:

NameType
ctxcontext.Context
taskExternalIdstring
nodeIdint64
branchIdint64

Returns:

Type
*rest.V1BranchDurableTaskResponse
error

Cancel

Cancel requests cancellation of a specific task within a workflow run.

func (r *RunsClient) Cancel(ctx context.Context, opts rest.V1CancelTaskRequest) (*rest.V1CancelledTasks, error)

Parameters:

NameType
ctxcontext.Context
optsrest.V1CancelTaskRequest

Returns:

Type
*rest.V1CancelledTasks
error

Get

Get retrieves a workflow run by its ID.

func (r *RunsClient) Get(ctx context.Context, runId string) (*rest.V1WorkflowRunDetails, error)

Parameters:

NameType
ctxcontext.Context
runIdstring

Returns:

Type
*rest.V1WorkflowRunDetails
error

GetDetails

GetDetails retrieves detailed information about a workflow run via gRPC, including task-level output, errors, and status.

func (r *RunsClient) GetDetails(ctx context.Context, runId uuid.UUID) (*client.RunDetails, error)

Parameters:

NameType
ctxcontext.Context
runIduuid.UUID

Returns:

Type
*client.RunDetails
error

GetStatus

GetStatus retrieves the status of a workflow run by its ID.

func (r *RunsClient) GetStatus(ctx context.Context, runId string) (*rest.V1TaskStatus, error)

Parameters:

NameType
ctxcontext.Context
runIdstring

Returns:

Type
*rest.V1TaskStatus
error

List

List retrieves a collection of workflow runs based on the provided parameters.

func (r *RunsClient) List(ctx context.Context, opts rest.V1WorkflowRunListParams) (*rest.V1TaskSummaryList, error)

Parameters:

NameType
ctxcontext.Context
optsrest.V1WorkflowRunListParams

Returns:

Type
*rest.V1TaskSummaryList
error

Replay

Replay requests a task to be replayed within a workflow run.

func (r *RunsClient) Replay(ctx context.Context, opts rest.V1ReplayTaskRequest) (*rest.V1ReplayedTasks, error)

Parameters:

NameType
ctxcontext.Context
optsrest.V1ReplayTaskRequest

Returns:

Type
*rest.V1ReplayedTasks
error

Restore

Restore re-enqueues an evicted task so it can resume execution.

func (r *RunsClient) Restore(ctx context.Context, taskExternalId string) (*rest.V1RestoreTaskResponse, error)

Parameters:

NameType
ctxcontext.Context
taskExternalIdstring

Returns:

Type
*rest.V1RestoreTaskResponse
error

SubscribeToStream

SubscribeToStream subscribes to streaming events for a specific workflow run.

func (r *RunsClient) SubscribeToStream(ctx context.Context, workflowRunId string) <-chan string

Parameters:

NameType
ctxcontext.Context
workflowRunIdstring

Returns:

Type
<-chan string

Last updated on August 24, 2026

On this page