Skip to main content

RunService

No overview available.

Methods


RecordAction()

@classmethod
def RecordAction(
ctx: context.Context,
req: *connect.Request[workflow.RecordActionRequest]
) - > *connect.Response[workflow.RecordActionResponse], error

Records a single action, including its details and status, within a workflow run. This method is used to persist the state of an action.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.RecordActionRequest]The request containing the action details to be recorded.

Returns

TypeDescription
*connect.Response[workflow.RecordActionResponse], errorA response containing the result of the action recording operation, or an error if the operation failed.

RecordActionStream()

@classmethod
def RecordActionStream(
ctx: context.Context,
stream: *connect.BidiStream[workflow.RecordActionStreamRequest, workflow.RecordActionStreamResponse]
) - > error

Establishes a bidirectional stream to record multiple actions in a workflow run. This allows for efficient, continuous updates of action states.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
stream*connect.BidiStream[workflow.RecordActionStreamRequest, workflow.RecordActionStreamResponse]The bidirectional stream for sending action recording requests and receiving responses.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

recordAction()

@classmethod
def recordAction(
ctx: context.Context,
req: *workflow.RecordActionRequest
) - > *workflow.RecordActionResponse

Records a single action's details and status. This internal method is likely called by the public RecordAction method.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*workflow.RecordActionRequestThe request containing the action details to be recorded.

Returns

TypeDescription
*workflow.RecordActionResponseA response containing the result of the action recording operation.

recordSingleAction()

@classmethod
def recordSingleAction(
ctx: context.Context,
req: *workflow.RecordActionRequest
) - > error

Persists the details of a single action to the data store. This method handles the underlying storage logic for recording an action.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*workflow.RecordActionRequestThe request containing the action details to be recorded.

Returns

TypeDescription
errorAn error if the action could not be recorded.

UpdateActionStatus()

@classmethod
def UpdateActionStatus(
ctx: context.Context,
req: *connect.Request[workflow.UpdateActionStatusRequest]
) - > *connect.Response[workflow.UpdateActionStatusResponse], error

Updates the status of a specific action within a workflow run. This method is used to reflect changes in an action's execution state.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.UpdateActionStatusRequest]The request containing the action identifier and the new status.

Returns

TypeDescription
*connect.Response[workflow.UpdateActionStatusResponse], errorA response indicating the success or failure of the status update, or an error if the operation failed.

UpdateActionStatusStream()

@classmethod
def UpdateActionStatusStream(
ctx: context.Context,
stream: *connect.BidiStream[workflow.UpdateActionStatusStreamRequest, workflow.UpdateActionStatusStreamResponse]
) - > error

Provides a bidirectional stream for updating the status of multiple actions. This enables real-time status synchronization for actions.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
stream*connect.BidiStream[workflow.UpdateActionStatusStreamRequest, workflow.UpdateActionStatusStreamResponse]The bidirectional stream for sending status update requests and receiving responses.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

updateActionStatus()

@classmethod
def updateActionStatus(
ctx: context.Context,
req: *workflow.UpdateActionStatusRequest
) - > *workflow.UpdateActionStatusResponse

Updates the status of a specific action. This internal method is likely called by the public UpdateActionStatus method.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*workflow.UpdateActionStatusRequestThe request containing the action identifier and the new status.

Returns

TypeDescription
*workflow.UpdateActionStatusResponseA response indicating the success or failure of the status update.

updateSingleActionStatus()

@classmethod
def updateSingleActionStatus(
ctx: context.Context,
req: *workflow.UpdateActionStatusRequest
) - > error

Persists the status update for a single action to the data store. This method handles the underlying storage logic for updating an action's status.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*workflow.UpdateActionStatusRequestThe request containing the action identifier and the new status.

Returns

TypeDescription
errorAn error if the action status could not be updated.

RecordActionEvents()

@classmethod
def RecordActionEvents(
ctx: context.Context,
req: *connect.Request[workflow.RecordActionEventsRequest]
) - > *connect.Response[workflow.RecordActionEventsResponse], error

Records a batch of events associated with an action. This method is used to log significant occurrences during an action's lifecycle.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.RecordActionEventsRequest]The request containing the action events to be recorded.

Returns

TypeDescription
*connect.Response[workflow.RecordActionEventsResponse], errorA response indicating the success or failure of the event recording, or an error if the operation failed.

RecordActionEventStream()

@classmethod
def RecordActionEventStream(
ctx: context.Context,
stream: *connect.BidiStream[workflow.RecordActionEventStreamRequest, workflow.RecordActionEventStreamResponse]
) - > error

Establishes a bidirectional stream for recording action events. This allows for continuous and efficient logging of events as they occur.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
stream*connect.BidiStream[workflow.RecordActionEventStreamRequest, workflow.RecordActionEventStreamResponse]The bidirectional stream for sending event recording requests and receiving responses.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

recordEvents()

@classmethod
def recordEvents(
ctx: context.Context,
events: []*workflow.ActionEvent
) - > error

Persists a list of action events to the data store. This method handles the underlying storage logic for recording events.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
events[]*workflow.ActionEventA slice of action events to be recorded.

Returns

TypeDescription
errorAn error if the events could not be recorded.

WatchGroups()

@classmethod
def WatchGroups(
ctx: context.Context,
req: *connect.Request[workflow.WatchGroupsRequest],
stream: *connect.ServerStream[workflow.WatchGroupsResponse]
) - > error

Establishes a server-side stream to watch for changes in task groups. This allows clients to receive real-time updates on group status and composition.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.WatchGroupsRequest]The request specifying criteria for watching task groups.
stream*connect.ServerStream[workflow.WatchGroupsResponse]The server-side stream to send group updates to the client.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

CreateRun()

@classmethod
def CreateRun(
ctx: context.Context,
req: *connect.Request[workflow.CreateRunRequest]
) - > *connect.Response[workflow.CreateRunResponse], error

Initiates a new workflow run based on the provided specifications. This method is the entry point for starting a workflow execution.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.CreateRunRequest]The request containing the specifications for the new workflow run.

Returns

TypeDescription
*connect.Response[workflow.CreateRunResponse], errorA response containing details of the newly created run, or an error if the run could not be created.

persistRunModel()

@classmethod
def persistRunModel(
ctx: context.Context,
runId: *common.RunIdentifier,
taskID: *task.TaskIdentifier,
taskSpec: *task.TaskSpec,
inputPrefix: string,
runOutputBase: string,
runSpec: *task.RunSpec,
source: workflow.RunSource,
triggerName: string,
triggerTaskName: string,
triggerRevision: int64,
triggerType: string
) - > *models.Run, error

Persists a new run model to the data store with all its associated metadata. This internal method handles the storage of run configuration and initial state.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
runId*common.RunIdentifierThe unique identifier for the run.
taskID*task.TaskIdentifierThe identifier of the task associated with this run.
taskSpec*task.TaskSpecThe specification of the task being executed.
inputPrefixstringThe prefix for input data paths related to this run.
runOutputBasestringThe base path for output data generated by this run.
runSpec*task.RunSpecThe specific runtime configuration for this run.
sourceworkflow.RunSourceThe source or origin of the workflow run (e.g., manual, scheduled).
triggerNamestringThe name of the trigger that initiated this run, if any.
triggerTaskNamestringThe name of the task associated with the trigger, if applicable.
triggerRevisionint64The revision number of the trigger, if applicable.
triggerTypestringThe type of trigger that initiated this run (e.g., 'schedule', 'webhook').

Returns

TypeDescription
*models.Run, errorThe persisted run model, or an error if the model could not be saved.

AbortRun()

@classmethod
def AbortRun(
ctx: context.Context,
req: *connect.Request[workflow.AbortRunRequest]
) - > *connect.Response[workflow.AbortRunResponse], error

Aborts an active workflow run, stopping all ongoing actions and marking the run as failed or aborted. This is used to terminate a run prematurely.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.AbortRunRequest]The request containing the identifier of the run to be aborted.

Returns

TypeDescription
*connect.Response[workflow.AbortRunResponse], errorA response indicating the success or failure of the abort operation, or an error if the operation failed.

GetRunDetails()

@classmethod
def GetRunDetails(
ctx: context.Context,
req: *connect.Request[workflow.GetRunDetailsRequest]
) - > *connect.Response[workflow.GetRunDetailsResponse], error

Fetches comprehensive details for a specific workflow run. This allows clients to retrieve all metadata and status information about a run.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.GetRunDetailsRequest]The request containing the identifier of the run whose details are to be retrieved.

Returns

TypeDescription
*connect.Response[workflow.GetRunDetailsResponse], errorA response containing the detailed information of the requested run, or an error if the run is not found or the operation failed.

GetActionDetails()

@classmethod
def GetActionDetails(
ctx: context.Context,
req: *connect.Request[workflow.GetActionDetailsRequest]
) - > *connect.Response[workflow.GetActionDetailsResponse], error

Retrieves detailed information for a specific action within a workflow run. This provides granular insight into an action's execution.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.GetActionDetailsRequest]The request containing the identifier of the action whose details are to be retrieved.

Returns

TypeDescription
*connect.Response[workflow.GetActionDetailsResponse], errorA response containing the detailed information of the requested action, or an error if the action is not found or the operation failed.

getActionDetails()

@classmethod
def getActionDetails(
ctx: context.Context,
actionId: *common.ActionIdentifier
) - > *workflow.ActionDetails, error

Fetches the detailed information for a specific action from the data store. This internal method retrieves the raw action data.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
actionId*common.ActionIdentifierThe unique identifier for the action.

Returns

TypeDescription
*workflow.ActionDetails, errorThe detailed information of the requested action, or an error if the action is not found.

buildActionDetails()

@classmethod
def buildActionDetails(
ctx: context.Context,
model: *models.Action,
actionId: *common.ActionIdentifier
) - > *workflow.ActionDetails, error

Constructs a comprehensive ActionDetails object from a raw action model and its identifier. This method enriches the basic action data with additional context.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
model*models.ActionThe raw action model retrieved from the data store.
actionId*common.ActionIdentifierThe unique identifier for the action.

Returns

TypeDescription
*workflow.ActionDetails, errorA fully populated ActionDetails object, or an error if details cannot be built.

getAttempts()

@classmethod
def getAttempts(
ctx: context.Context,
actionId: *common.ActionIdentifier
) - > []*workflow.ActionAttempt, error

Retrieves all attempts associated with a specific action. This is useful for understanding retries and execution history of an action.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
actionId*common.ActionIdentifierThe unique identifier for the action.

Returns

TypeDescription
[]*workflow.ActionAttempt, errorA slice of action attempts, or an error if attempts cannot be retrieved.

GetActionData()

@classmethod
def GetActionData(
ctx: context.Context,
req: *connect.Request[workflow.GetActionDataRequest]
) - > *connect.Response[workflow.GetActionDataResponse], error

Fetches the input and output data associated with a specific action. This allows clients to inspect the data processed by an action.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.GetActionDataRequest]The request containing the identifier of the action whose data is to be retrieved.

Returns

TypeDescription
*connect.Response[workflow.GetActionDataResponse], errorA response containing the action's input and output data, or an error if the data is not found or the operation failed.

ListRuns()

@classmethod
def ListRuns(
ctx: context.Context,
req: *connect.Request[workflow.ListRunsRequest]
) - > *connect.Response[workflow.ListRunsResponse], error

Lists workflow runs based on specified filters and pagination criteria. This method is used to browse and search for workflow executions.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.ListRunsRequest]The request containing filters, sorting, and pagination parameters for listing runs.

Returns

TypeDescription
*connect.Response[workflow.ListRunsResponse], errorA response containing a list of workflow runs matching the criteria, or an error if the operation failed.

ListActions()

@classmethod
def ListActions(
ctx: context.Context,
req: *connect.Request[workflow.ListActionsRequest]
) - > *connect.Response[workflow.ListActionsResponse], error

Lists actions within a specific workflow run, or across runs, based on provided filters. This method allows for querying and viewing action history.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.ListActionsRequest]The request containing filters, sorting, and pagination parameters for listing actions.

Returns

TypeDescription
*connect.Response[workflow.ListActionsResponse], errorA response containing a list of actions matching the criteria, or an error if the operation failed.

GetActionDataURIs()

@classmethod
def GetActionDataURIs(
ctx: context.Context,
req: *connect.Request[workflow.GetActionDataURIsRequest]
) - > *connect.Response[workflow.GetActionDataURIsResponse], error

Retrieves URIs for the input and output data of a specific action. This allows clients to directly access the data stored externally.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.GetActionDataURIsRequest]The request containing the identifier of the action whose data URIs are to be retrieved.

Returns

TypeDescription
*connect.Response[workflow.GetActionDataURIsResponse], errorA response containing the URIs for the action's data, or an error if the URIs cannot be generated or the operation failed.

GetActionLogContext()

@classmethod
def GetActionLogContext(
ctx: context.Context,
req: *connect.Request[workflow.GetActionLogContextRequest]
) - > *connect.Response[workflow.GetActionLogContextResponse], error

Retrieves contextual information for an action's logs, such as log stream identifiers or links. This helps in locating and accessing action logs.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.GetActionLogContextRequest]The request containing the identifier of the action whose log context is to be retrieved.

Returns

TypeDescription
*connect.Response[workflow.GetActionLogContextResponse], errorA response containing the log context for the action, or an error if the context cannot be retrieved or the operation failed.

AbortAction()

@classmethod
def AbortAction(
ctx: context.Context,
req: *connect.Request[workflow.AbortActionRequest]
) - > *connect.Response[workflow.AbortActionResponse], error

Aborts a specific action within a workflow run, stopping its execution. This is used to terminate an individual action prematurely.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.AbortActionRequest]The request containing the identifier of the action to be aborted.

Returns

TypeDescription
*connect.Response[workflow.AbortActionResponse], errorA response indicating the success or failure of the action abort operation, or an error if the operation failed.

SignalEvent()

@classmethod
def SignalEvent(
ctx: context.Context,
_: *connect.Request[workflow.SignalEventRequest]
) - > *connect.Response[workflow.SignalEventResponse], error

Sends a signal event to the workflow system, which can trigger specific behaviors or state transitions. This allows for external interaction with running workflows.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
_*connect.Request[workflow.SignalEventRequest]The request containing the details of the signal event to be sent.

Returns

TypeDescription
*connect.Response[workflow.SignalEventResponse], errorA response indicating the success or failure of the signal event, or an error if the operation failed.

WatchRunDetails()

@classmethod
def WatchRunDetails(
ctx: context.Context,
req: *connect.Request[workflow.WatchRunDetailsRequest],
stream: *connect.ServerStream[workflow.WatchRunDetailsResponse]
) - > error

Establishes a server-side stream to watch for real-time updates to a specific workflow run's details. This allows clients to stay synchronized with run state changes.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.WatchRunDetailsRequest]The request specifying the run to watch and any filtering criteria.
stream*connect.ServerStream[workflow.WatchRunDetailsResponse]The server-side stream to send run detail updates to the client.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

WatchActionDetails()

@classmethod
def WatchActionDetails(
ctx: context.Context,
req: *connect.Request[workflow.WatchActionDetailsRequest],
stream: *connect.ServerStream[workflow.WatchActionDetailsResponse]
) - > error

Establishes a server-side stream to watch for real-time updates to a specific action's details. This allows clients to monitor individual action progress.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.WatchActionDetailsRequest]The request specifying the action to watch and any filtering criteria.
stream*connect.ServerStream[workflow.WatchActionDetailsResponse]The server-side stream to send action detail updates to the client.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

WatchRuns()

@classmethod
def WatchRuns(
ctx: context.Context,
req: *connect.Request[workflow.WatchRunsRequest],
stream: *connect.ServerStream[workflow.WatchRunsResponse]
) - > error

Establishes a server-side stream to watch for changes and new workflow runs based on specified criteria. This allows clients to receive continuous updates on run activity.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.WatchRunsRequest]The request specifying filters and other criteria for watching runs.
stream*connect.ServerStream[workflow.WatchRunsResponse]The server-side stream to send run updates to the client.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

WatchActions()

@classmethod
def WatchActions(
ctx: context.Context,
req: *connect.Request[workflow.WatchActionsRequest],
stream: *connect.ServerStream[workflow.WatchActionsResponse]
) - > error

Establishes a server-side stream to watch for changes and new actions within a workflow run or across multiple runs. This allows clients to receive continuous updates on action activity.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.WatchActionsRequest]The request specifying filters and other criteria for watching actions.
stream*connect.ServerStream[workflow.WatchActionsResponse]The server-side stream to send action updates to the client.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

listAndSendAllActions()

@classmethod
def listAndSendAllActions(
ctx: context.Context,
runID: *common.RunIdentifier,
rsm: *runStateManager,
stream: *connect.ServerStream[workflow.WatchActionsResponse]
) - > error

Lists all actions for a given run ID and sends them over the provided server stream. This is typically used to initialize a client's view of actions.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
runID*common.RunIdentifierThe unique identifier of the run whose actions are to be listed and sent.
rsm*runStateManagerThe run state manager used to retrieve action information.
stream*connect.ServerStream[workflow.WatchActionsResponse]The server-side stream to which action updates will be sent.

Returns

TypeDescription
errorAn error if listing or sending actions fails.

sendChangedActions()

@classmethod
def sendChangedActions(
runID: *common.RunIdentifier,
updates: []*nodeUpdate,
stream: *connect.ServerStream[workflow.WatchActionsResponse]
) - > error

Sends only the changed actions (node updates) for a given run ID over the provided server stream. This optimizes updates by only sending deltas.

Parameters

NameTypeDescription
runID*common.RunIdentifierThe unique identifier of the run for which action changes are to be sent.
updates[]*nodeUpdateA slice of node updates representing the changed actions.
stream*connect.ServerStream[workflow.WatchActionsResponse]The server-side stream to which action updates will be sent.

Returns

TypeDescription
errorAn error if sending changed actions fails.

WatchClusterEvents()

@classmethod
def WatchClusterEvents(
ctx: context.Context,
req: *connect.Request[workflow.WatchClusterEventsRequest],
stream: *connect.ServerStream[workflow.WatchClusterEventsResponse]
) - > error

Establishes a server-side stream to watch for cluster-level events related to workflow execution. This provides insights into the underlying infrastructure's activity.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*connect.Request[workflow.WatchClusterEventsRequest]The request specifying criteria for watching cluster events.
stream*connect.ServerStream[workflow.WatchClusterEventsResponse]The server-side stream to send cluster event updates to the client.

Returns

TypeDescription
errorAn error if the stream operation encounters an issue.

getClusterEventsInfo()

@classmethod
def getClusterEventsInfo(
ctx: context.Context,
actionID: *common.ActionIdentifier,
attempt: uint32,
since: time.Time,
offset: int,
limit: int
) - > clusterEventsInfo, error

Retrieves information about cluster events for a specific action attempt, with optional time, offset, and limit filters. This is used to paginate and filter cluster event logs.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
actionID*common.ActionIdentifierThe unique identifier of the action.
attemptuint32The attempt number for the action.
sincetime.TimeThe starting timestamp for retrieving events.
offsetintThe number of events to skip from the beginning.
limitintThe maximum number of events to retrieve.

Returns

TypeDescription
clusterEventsInfo, errorA structure containing cluster event information, or an error if the events cannot be retrieved.

actionModelToDetails()

@classmethod
def actionModelToDetails(
action: *models.Action,
actionID: *common.ActionIdentifier
) - > *workflow.ActionDetails

Converts an internal action model into a public-facing ActionDetails protobuf message. This method transforms raw data into a structured API response.

Parameters

NameTypeDescription
action*models.ActionThe internal action model to convert.
actionID*common.ActionIdentifierThe unique identifier for the action.

Returns

TypeDescription
*workflow.ActionDetailsThe converted ActionDetails protobuf message.

convertRunToProto()

@classmethod
def convertRunToProto(
run: *models.Run
) - > *workflow.Run

Converts an internal run model into a public-facing Run protobuf message. This method transforms raw run data into a structured API response.

Parameters

NameTypeDescription
run*models.RunThe internal run model to convert.

Returns

TypeDescription
*workflow.RunThe converted Run protobuf message.

convertActionToEnrichedProto()

@classmethod
def convertActionToEnrichedProto(
action: *models.Action
) - > *workflow.EnrichedAction

Converts an internal action model into an EnrichedAction protobuf message, adding additional context or derived information. This provides a more complete view of an action for clients.

Parameters

NameTypeDescription
action*models.ActionThe internal action model to convert.

Returns

TypeDescription
*workflow.EnrichedActionThe converted EnrichedAction protobuf message.

convertNodeUpdateToEnrichedProto()

@classmethod
def convertNodeUpdateToEnrichedProto(
runID: *common.RunIdentifier,
update: *nodeUpdate
) - > *workflow.EnrichedAction

Converts a node update (representing a change in an action) into an EnrichedAction protobuf message. This is used to send incremental updates to clients watching actions.

Parameters

NameTypeDescription
runID*common.RunIdentifierThe unique identifier of the run to which the action belongs.
update*nodeUpdateThe node update containing the changed action information.

Returns

TypeDescription
*workflow.EnrichedActionThe converted EnrichedAction protobuf message representing the updated action.

buildTaskGroups()

@classmethod
def buildTaskGroups(
ctx: context.Context,
req: *workflow.WatchGroupsRequest
) - > []*workflow.TaskGroup, error

Builds a list of task groups based on the provided watch request. This method aggregates actions into logical groups for display or management.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
req*workflow.WatchGroupsRequestThe request containing criteria for building task groups.

Returns

TypeDescription
[]*workflow.TaskGroup, errorA slice of TaskGroup protobuf messages, or an error if groups cannot be built.

convertWatchRequestToListInput()

@classmethod
def convertWatchRequestToListInput(
req: *workflow.WatchRunsRequest
) - > interfaces.ListResourceInput

Converts a WatchRunsRequest into a generic ListResourceInput interface. This abstracts the watch request for use with common listing logic.

Parameters

NameTypeDescription
req*workflow.WatchRunsRequestThe WatchRunsRequest to convert.

Returns

TypeDescription
interfaces.ListResourceInputA generic ListResourceInput interface derived from the watch request.

runMatchesFilter()

@classmethod
def runMatchesFilter(
run: *models.Run,
req: *workflow.WatchRunsRequest
) - > bool

Checks if a given run model matches the filters specified in a WatchRunsRequest. This is used internally to filter runs for streaming updates.

Parameters

NameTypeDescription
run*models.RunThe internal run model to check against the filter.
req*workflow.WatchRunsRequestThe WatchRunsRequest containing the filter criteria.

Returns

TypeDescription
boolTrue if the run matches the filter criteria, false otherwise.