LittleHorse API Reference
The LittleHorse Server exposes a GRPC API to its clients. For most general usage of LittleHorse, you will not need to
read the raw protobuf schema. Common LittleHorse client actions fall into three general categories:
- Developing a Task Worker, which is handled by our Task Worker SDK's.
- Developing a WfSpec, which is handled by our
WfSpec
SDK's.
- Running and interacting with
WfRun
's, which is documented in our "Using the API" docs.
However, the highly curious reader might want to see the actual GRPC and Protobuf specification. The docs on this page
are autogenerated from our actual protobuf files.
The documentation of what the specific protobuf fields mean is potentially useful for advanced Jedi Master use-cases.
Happy Reading!
LittleHorse GRPC API
The LittleHorse GRPC API is the backbone of the clients that you get in all of our SDK's. Every LHConfig
object
gives you a GRPC stub to access the API. Most common operations are already documented with code examples in different
languages here, but we put this here for the true Jedi Masters.
RPC PutTaskDef
RPC GetTaskDef
RPC GetTaskWorkerGroup
Request Type | Response Type | Description |
---|
TaskDefId | TaskWorkerGroup | Gets the registered task worker group associated with a specific TaskDef. |
RPC PutExternalEventDef
RPC GetExternalEventDef
RPC PutWorkflowEventDef
RPC PutWfSpec
RPC GetWfSpec
RPC GetLatestWfSpec
Request Type | Response Type | Description |
---|
GetLatestWfSpecRequest | WfSpec | Returns the latest WfSpec with a specified name (and optionally a specified Major Version). |
RPC MigrateWfSpec
Request Type | Response Type | Description |
---|
MigrateWfSpecRequest | WfSpec | EXPERIMENTAL: Migrates all WfRun's from one version of a WfSpec onto a newer version of the same WfSpec. This is useful for long-running WfRun's (eg. a 60-day marketing campaign) where you must update WfRun's that are in the RUNNING state rather than allowing them to run to completion.
As of 0.7.2, this feature is only partially implemented. |
RPC PutUserTaskDef
RPC GetUserTaskDef
Request Type | Response Type | Description |
---|
UserTaskDefId | UserTaskDef | Gets a specific UserTaskDef.
This RPC is highly useful for applications built around User Tasks. For example, a UI that dynamically displays form fields based on the User Task might first receive a UserTaskRun, then use that UserTaskRun to look up the UserTaskDef. The frontend would inspect the UserTaskDef and display a form field on the browser page for each field in the UserTaskDef. |
RPC GetLatestUserTaskDef
RPC RunWf
Request Type | Response Type | Description |
---|
RunWfRequest | WfRun | Runs a WfSpec to create a WfRun. |
RPC ScheduleWf
RPC SearchScheduledWfRun
RPC GetScheduledWfRun
RPC GetWfRun
Request Type | Response Type | Description |
---|
WfRunId | WfRun | Gets a WfRun. Although useful for development and debugging, this RPC is not often used by applications. |
RPC GetUserTaskRun
Request Type | Response Type | Description |
---|
UserTaskRunId | UserTaskRun | Loads a specific UserTaskRun. It includes information about to whom the UserTask is currently assigned, history of assignments and reassignments, and any context for that UserTaskRun which is specific to the WfRun. |
RPC AssignUserTaskRun
Request Type | Response Type | Description |
---|
AssignUserTaskRunRequest | .google.protobuf.Empty | Change the ownership of a UserTaskRun to a new userId, userGroup, or both. The action will be reflected in your next call to SearchUserTaskRun. This RPC is useful for applications that are using User Tasks to build an internal task-list and wish to administer the tasks. |
RPC CompleteUserTaskRun
Request Type | Response Type | Description |
---|
CompleteUserTaskRunRequest | .google.protobuf.Empty | Completes a UserTaskRun. Includes the results of the UserTaskRun, the UserTaskRun Id, and the userId of the user who completes the UserTaskRun. Results in the UserTask NodeRun being completed, and unblocks the associated ThreadRun in the WfRun.
This RPC is highly useful for applications built around a WfSpec that uses USER_TASK nodes. |
RPC CancelUserTaskRun
Request Type | Response Type | Description |
---|
CancelUserTaskRunRequest | .google.protobuf.Empty | Cancels a UserTaskRun. This will result in an EXCEPTION being propagated to the WfRun. |
RPC SaveUserTaskRunProgress
Request Type | Response Type | Description |
---|
SaveUserTaskRunProgressRequest | UserTaskRun | Saves the results of a UserTaskRun and logs who saved the content.
Throws FAILED_PRECONDITION if the UserTaskRun is in the DONE or CANCELLED state. If policy is set to FAIL_IF_CLAIMED_BY_OTHER , returns FAILED_PRECONDITION if the user_id field of the UserTaskRun does not match the user_id of the request. |
RPC ListUserTaskRuns
RPC GetNodeRun
RPC ListNodeRuns
RPC GetTaskRun
RPC ListTaskRuns
RPC GetVariable
Request Type | Response Type | Description |
---|
VariableId | Variable | Get the value of a specific Variable. When using a WfRun to model an entity, this RPC is useful for retrieving information. It is equivalent to looking up the value of a column for a specific row in a SQL table. |
RPC ListVariables
RPC PutExternalEvent
RPC GetExternalEvent
RPC AwaitWorkflowEvent
Request Type | Response Type | Description |
---|
AwaitWorkflowEventRequest | WorkflowEvent | Waits for a WorkflowEvent to be thrown by a given WfRun. Returns immediately if a matching WorkflowEvent has already been thrown; throws a DEADLINE_EXCEEDED error if the WorkflowEvent is not thrown before the deadline specified by the client.
To specify the deadline, the client should use GRPC deadlines. |
RPC GetWorkflowEventDef
RPC GetWorkflowEvent
RPC ListExternalEvents
RPC ListWorkflowEvents
RPC SearchWfRun
Request Type | Response Type | Description |
---|
SearchWfRunRequest | WfRunIdList | Search for WfRun's. This RPC is highly useful for applications that store data in LittleHorse and need to find a specific WfRun based on certain indexed fields. |
RPC SearchNodeRun
Request Type | Response Type | Description |
---|
SearchNodeRunRequest | NodeRunIdList | Search for NodeRun's. This RPC is useful for monitoring and finding bugs in your workflows or Task Workers. |
RPC SearchTaskRun
RPC SearchUserTaskRun
Request Type | Response Type | Description |
---|
SearchUserTaskRunRequest | UserTaskRunIdList | Search for UserTaskRun's. This RPC is highly useful for applications that connect human end-users to LittleHorse: it enables you to find all tasks assigned to a specific person or group of people. |
RPC SearchVariable
Request Type | Response Type | Description |
---|
SearchVariableRequest | VariableIdList | Search for Variable's. This RPC is highly useful for applications that store data in LittleHorse and need to find a specific WfRun based on certain indexed fields. |
RPC SearchExternalEvent
RPC SearchWorkflowEvent
RPC SearchTaskDef
RPC SearchUserTaskDef
RPC SearchWfSpec
RPC SearchExternalEventDef
RPC SearchWorkflowEventDef
RPC SearchTenant
RPC SearchPrincipal
RPC RegisterTaskWorker
Request Type | Response Type | Description |
---|
RegisterTaskWorkerRequest | RegisterTaskWorkerResponse | Used by the Task Worker to: 1. Tell the LH Server that the Task Worker has joined the Task Worker Group. 2. Receive the assignemnt of LH Server's to poll from. Generally, you won't use this request manually. |
RPC PollTask
Request Type | Response Type | Description |
---|
PollTaskRequest | PollTaskResponse | Used by Task Workers to listen for TaskRuns on the Task Queue. Generally, you won't use this RPC manually. |
RPC ReportTask
Request Type | Response Type | Description |
---|
ReportTaskRun | .google.protobuf.Empty | Used by Task Workers to report the result of a TaskRun. Generally, you won't use this rpc manually. |
RPC StopWfRun
Request Type | Response Type | Description |
---|
StopWfRunRequest | .google.protobuf.Empty | Move a WfRun or a specific ThreadRun in that WfRun to the HALTED state. |
RPC ResumeWfRun
Request Type | Response Type | Description |
---|
ResumeWfRunRequest | .google.protobuf.Empty | Resumes a WfRun or a specific ThreadRun of a WfRun. |
RPC RescueThreadRun
Request Type | Response Type | Description |
---|
RescueThreadRunRequest | WfRun | Rescues a failed ThreadRun (in the ERROR state only) by restarting it from the point of failure. Useful if a bug in Task Worker implementation caused a WfRun to fail and you did not have a FailureHandler for that NodeRun.
The specified ThreadRun must be in a state where it's latest NodeRun is: - In the ERROR state. - Has no FailureHandler ThreadRun s - The parent ThreadRun , or any parent of the parent, has not handled the Failure yet.
If that is not true, then the ThreadRun cannot be rescued and the request will return FAILED_PRECONDITION . |
RPC DeleteWfRun
Request Type | Response Type | Description |
---|
DeleteWfRunRequest | .google.protobuf.Empty | Deletes a WfRun. The WfRun cannot be in the RUNNING state. |
RPC DeleteTaskDef
RPC DeleteWfSpec
RPC DeleteUserTaskDef
RPC DeleteExternalEventDef
RPC DeleteWorkflowEventDef
RPC DeletePrincipal
Request Type | Response Type | Description |
---|
DeletePrincipalRequest | .google.protobuf.Empty | Deletes a Principal . Fails with FAILED_PRECONDITION if the specified Principal is the last remaining Principal with admin permissions. Admin permissions are defined as having the global_acls of ALL_ACTIONS over the ACL_ALL_RESOURCES scope. |
RPC DeleteScheduledWfRun
Request Type | Response Type | Description |
---|
DeleteScheduledWfRunRequest | .google.protobuf.Empty | Deletes a scheduled run and prevents any further associated WfRun from being executed. |
RPC GetTaskDefMetricsWindow
RPC GetWfSpecMetricsWindow
RPC ListTaskDefMetrics
RPC ListWfSpecMetrics
RPC PutTenant
Request Type | Response Type | Description |
---|
PutTenantRequest | Tenant | EXPERIMENTAL: Creates another Tenant in the LH Server. |
RPC GetTenant
Request Type | Response Type | Description |
---|
TenantId | Tenant | EXPERIMENTAL: Gets a Tenant from the LH Server. |
RPC PutPrincipal
RPC GetPrincipal
RPC Whoami
Request Type | Response Type | Description |
---|
.google.protobuf.Empty | Principal | Returns the Principal of the caller. |
RPC GetServerVersion
Request Type | Response Type | Description |
---|
.google.protobuf.Empty | ServerVersion | Gets the version of the LH Server. |
LittleHorse Protobuf Schemas
This section contains the exact schemas for every object in our public API.
Message DeletePrincipalRequest
Deletes a Principal
. Fails with FAILED_PRECONDITION
if the specified Principal
is the last
admin Principal
.
Field | Label | Type | Description |
---|
id | | PrincipalId | The ID of the Principal to delete. |
Message Principal
A Principal represents the identity of a client of LittleHorse, whether human or
machine. The ACL's on the Principal control what actions the client is allowed
to take.
A Principal is not scoped to a Tenant; rather, a Principal is scoped to the Cluster
and may have access to one or more Tenants.
Field | Label | Type | Description |
---|
id | | PrincipalId | The ID of the Principal. In OAuth for human users, this is the user_id. In OAuth for machine clients, this is the Client ID.
mTLS for Principal identification is not yet implemented. |
created_at | | google.protobuf.Timestamp | The time at which the Principal was created. |
per_tenant_acls | map | Principal.PerTenantAclsEntry | Maps a Tenant ID to a list of ACL's that the Principal has permission to execute within that Tenant. |
global_acls | | ServerACLs | Sets permissions that this Principal has for any Tenant in the LH Cluster. |
Message Principal.PerTenantAclsEntry
Message PutPrincipalRequest
Creates or updates a Principal. If this request would remove admin privileges from the
last admin principal (i.e. ALL_ACTIONS
over ACL_ALL_RESOURCES
in the global_acls
),
then the RPC throws FAILED_PRECONDITION
.
Field | Label | Type | Description |
---|
id | | string | The ID of the Principal that we are creating. |
per_tenant_acls | map | PutPrincipalRequest.PerTenantAclsEntry | The per-tenant ACL's for the Principal |
global_acls | | ServerACLs | The ACL's for the principal in all tenants |
overwrite | | bool | If this is set to false and a Principal with the same id already exists and has different ACL's configured, then the RPC throws ALREADY_EXISTS .
If this is set to true , then the RPC will override hte |
Message PutPrincipalRequest.PerTenantAclsEntry
Message PutTenantRequest
Field | Label | Type | Description |
---|
id | | string | |
Message ServerACL
Represents a specific set of permissions over a specific set of objects
in a Tenant. This is a positive permission.
Field | Label | Type | Description |
---|
resources | repeated | ACLResource | The resource types over which permission is granted. |
allowed_actions | repeated | ACLAction | The actions that are permitted. |
name | oneof resource_filter | string | If set, then only the resources with this exact name are allowed. For example, the READ and RUN allowed_actions over ACL_TASK with name == my-task allows a Task Worker to only execute the my-task TaskDef.
If name and prefix are unset, then the ACL applies to all resources of the specified types. |
prefix | oneof resource_filter | string | If set, then only the resources whose names match this prefix are allowed.
If name and prefix are unset, then the ACL applies to all resources of the specified types. |
Message ServerACLs
List of ACL's for LittleHorse
Field | Label | Type | Description |
---|
acls | repeated | ServerACL | The associated ACL's |
Message Tenant
A Tenant is a logically isolated environment within LittleHorse. All workflows and
associated data (WfSpec, WfRun, TaskDef, TaskRun, NodeRun, etc) are scoped to within
a Tenant.
Future versions will include quotas on a per-Tenant basis.
Field | Label | Type | Description |
---|
id | | TenantId | The ID of the Tenant. |
created_at | | google.protobuf.Timestamp | The time at which the Tenant was created. |
Message ExponentialBackoffRetryPolicy
Defines an Exponential backoff policy for TaskRun retries. The delay for a retry
attempt N
is defined as:
min(base_interval_ms * (multiplier ^(N-1)), max_delay_ms)
Note that timers in LittleHorse have a resolution of about 500-1000 milliseconds,
so timing is not exact.
Field | Label | Type | Description |
---|
base_interval_ms | | int32 | Base delay in ms for the first retry. Note that in LittleHorse, timers have a resolution of 500-1000 milliseconds. Must be greater than zero. |
max_delay_ms | | int64 | Maximum delay in milliseconds between retries. |
multiplier | | float | The multiplier to use in calculating the retry backoff policy. We recommend starting with 2.0. Must be at least 1.0. |
Message TaskNode
Defines a TaskRun execution. Used in a Node and also in the UserTask Trigger Actions.
Field | Label | Type | Description |
---|
task_def_id | oneof task_to_execute | TaskDefId | |
dynamic_task | oneof task_to_execute | VariableAssignment | |
timeout_seconds | | int32 | How long until LittleHorse determines that the Task Worker had a technical ERROR if the worker does not yet reply to the Server. This is determined on a per-Attempt basis. |
retries | | int32 | Configures the amount of retries allowed on this TaskNode.
Retryable errors include: - TASK_TIMEOUT: the TaskRun was started but the scheduler didn't hear back from the Task Worker in time. - TASK_FAILED: the Task Worker reported an unexpected technical ERROR when executing the Task Function.
Other result codes are not retryable (including TASK_OUTPUT_SERIALIZING_ERROR, TASK_INPUT_VAR_SUB_ERROR, and TASK_EXCEPTION). |
exponential_backoff | optional | ExponentialBackoffRetryPolicy | If this field is set, then retries will use Exponential Backoff. |
variables | repeated | VariableAssignment | Input variables into the TaskDef. |
Message UTActionTrigger
A UTActionTrigger triggers an action upon certain lifecycle hooks
in a User Task. Actions include:
- re-assign the User Task Run
- cancel the User Task Run
- execute a Reminder Task
Hooks include:
- Upon creation of the UserTaskRun
- Upon rescheduling the UserTaskRun
Message UTActionTrigger.UTACancel
A UserTaskAction that causes a UserTaskRun to be CANCELLED when it fires.
Message UTActionTrigger.UTAReassign
A UserTaskAction that causes a UserTaskRun to be reassigned when it fires.
Field | Label | Type | Description |
---|
user_id | optional | VariableAssignment | A variable assignment that resolves to a STR representing the new user_id. If not set, the user_id of the UserTaskRun will be un-set. |
user_group | optional | VariableAssignment | A variable assignment that resolves to a STR representing the new user_group. If not set, the user_group of the UserTaskRun will be un-set. |
Message UTActionTrigger.UTATask
A UserTaskAction that causes a TaskRun to be scheduled when it fires.
Field | Label | Type | Description |
---|
task | | TaskNode | The specification of the Task to schedule. |
mutations | repeated | VariableMutation | EXPERIMENTAL: Any variables in the ThreadRun which we should mutate. |
Message VariableAssignment
A VariableAssignment is used within a WfSpec to determine how a value should be
assigned in the context of a specific WfRun. For example, in a TASK node, you
use a VariableAssignment for each input parameter to determine how the value
is set.
Note that the VariableAssignment is normally handled by the SDK; you shouldn't
have to worry about this in daily LittleHorse usage.
Field | Label | Type | Description |
---|
json_path | optional | string | If you provide a variable_name and the specified variable is JSON_OBJ or JSON_ARR type, then you may also provide a json_path which makes the VariableAssignment resolve to the specified field. |
variable_name | oneof source | string | Assign the value from a variable. |
literal_value | oneof source | VariableValue | Assign a literal value |
format_string | oneof source | VariableAssignment.FormatString | Assign a format string |
node_output | oneof source | VariableAssignment.NodeOutputReference | Assign the value of a NodeOutput. |
expression | oneof source | VariableAssignment.Expression | Assign the value of an Expression. |
Message VariableAssignment.Expression
An Expression allows you to combine multiple values into one.
A FormatString formats a template String with values from the WfRun.
Field | Label | Type | Description |
---|
format | | VariableAssignment | A VariableAssignment which must resolve to a String that has format args. A valid string is "This is a format string with three args: 0, 1, 2" |
args | repeated | VariableAssignment | VariableAssignments which fill out the args. |
Message VariableAssignment.NodeOutputReference
A NodeOutputReference allows you to assign a value by getting the output of
a NodeRun from a specified Node. If there are multiple NodeRun's of the specified
Node (for example, if there is a loop in the ThreadSpec), then the most recent
NodeRun is used. Can only specify a Node that is in the same ThreadSpec.
Field | Label | Type | Description |
---|
node_name | | string | The name of the Node to pull output from. |
Message VariableDef
Declares a Variable.
Field | Label | Type | Description |
---|
type | | VariableType | The Type of the variable. |
name | | string | The name of the variable. |
default_value | optional | VariableValue | Optional default value if the variable isn't set; for example, in a ThreadRun if you start a ThreadRun or WfRun without passing a variable in, then this is used. |
masked_value | | bool | If true, the variable value will show as a masked string. |
Message VariableMutation
A VariableMutation defines a modification made to one of a ThreadRun's variables.
The LHS determines the variable that is modified; the operation determines how
it is modified, and the RHS is the input to the operation.
Day-to-day users of LittleHorse generally don't interact with this structure unless
they are writing their own WfSpec SDK.
Field | Label | Type | Description |
---|
lhs_name | | string | The name of the variable to mutate |
lhs_json_path | optional | string | For JSON_ARR and JSON_OBJ variables, this allows you to optionally mutate a specific sub-field of the variable. |
operation | | VariableMutationType | Defines the operation that we are executing. |
rhs_assignment | oneof rhs_value | VariableAssignment | Assigns the value to be used as the RHS of the mutation. |
literal_value | oneof rhs_value | VariableValue | Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value instead. |
node_output | oneof rhs_value | VariableMutation.NodeOutputSource | Use the output of the current node as the RHS. DEPRECATED: use rhs_assignment.node_output instead. |
Message VariableMutation.NodeOutputSource
Specifies to use the output of a NodeRun as the RHS.
Field | Label | Type | Description |
---|
jsonpath | optional | string | Use this specific field from a JSON output |
Message ExternalEvent
An ExternalEvent represents A Thing That Happened outside the context of a WfRun.
Generally, an ExternalEvent is used to represent a document getting signed, an incident
being resolved, an order being fulfilled, etc.
ExternalEvent's are created via the 'rpc PutExternalEvent'
For more context on ExternalEvents, check our documentation here:
/docs/server/concepts/external-events
Field | Label | Type | Description |
---|
id | | ExternalEventId | The ID of the ExternalEvent. This contains WfRunId, ExternalEventDefId, and a unique guid which can be used for idempotency of the PutExternalEvent rpc call. |
created_at | | google.protobuf.Timestamp | The time the ExternalEvent was registered with LittleHorse. |
content | | VariableValue | The payload of this ExternalEvent. |
thread_run_number | optional | int32 | If the ExternalEvent was claimed by a specific ThreadRun (via Interrupt or EXTERNAL_EVENT Node), this is set to the number of the relevant ThreadRun. |
node_run_position | optional | int32 | If the ExternalEvent was claimed by a specific ThreadRun (via EXTERNAL_EVENT Node; note that in the case of an Interrupt the node_run_position will never be set), this is set to the number of the relevant NodeRun. |
claimed | | bool | Whether the ExternalEvent has been claimed by a WfRun. |
Message ExternalEventDef
The ExternalEventDef defines the blueprint for an ExternalEvent.
Field | Label | Type | Description |
---|
id | | ExternalEventDefId | The id of the ExternalEventDef. |
created_at | | google.protobuf.Timestamp | When the ExternalEventDef was created. |
retention_policy | | ExternalEventRetentionPolicy | The retention policy for ExternalEvent's of this ExternalEventDef. This applies to the ExternalEvent only before it is matched with a WfRun. |
Message ExternalEventRetentionPolicy
Policy to determine how long an ExternalEvent is retained after creation if it
is not yet claimed by a WfRun. Note that once a WfRun has been matched with the
ExternalEvent, the ExternalEvent is deleted if/when that WfRun is deleted.
If not set, then ExternalEvent's are not deleted if they are not matched with
a WfRun.
A future version of LittleHorse will allow changing the retention_policy, which
will trigger a cleanup of old ExternalEvent
s.
Field | Label | Type | Description |
---|
seconds_after_put | oneof ext_evt_gc_policy | int64 | Delete such an ExternalEvent X seconds after it has been registered if it has not yet been claimed by a WfRun. |
Message EntrypointRun
The sub-node structure for an ENTRYPOINT NodeRun. Currently Empty.
Message ExitRun
The sub-node structure for an EXIT NodeRun. Currently Empty, will contain info
about ThreadRun Outputs once those are added in the future.
Message ExternalEventNodeRun
The sub-node structure for an EXTERNAL_EVENT NodeRun.
Field | Label | Type | Description |
---|
external_event_def_id | | ExternalEventDefId | The ExternalEventDefId that we are waiting for. |
event_time | optional | google.protobuf.Timestamp | The time that the ExternalEvent arrived. Unset if still waiting. |
external_event_id | optional | ExternalEventId | The ExternalEventId of the ExternalEvent. Unset if still waiting. |
timed_out | | bool | Whether we had a timeout while waiting for the ExternalEvent to come. |
Message Failure
Denotes a failure that happened during execution of a NodeRun or the outgoing
edges.
Field | Label | Type | Description |
---|
failure_name | | string | The name of the failure. LittleHorse has certain built-in failures, all named in UPPER_UNDERSCORE_CASE. Such failures correspond with the LHStatus.ERROR .
Any Failure named in kebab-case is a user-defined business EXCEPTION , treated as an LHStatus.EXCEPTION . |
message | | string | The human-readable message associated with this Failure. |
content | optional | VariableValue | A user-defined Failure can have a value; for example, in Java an Exception is an Object with arbitrary properties and behaviors.
Future versions of LH will allow FailureHandler threads to accept that value as an input variable. |
was_properly_handled | | bool | A boolean denoting whether a Failure Handler ThreadRun properly handled the Failure. |
failure_handler_threadrun_id | optional | int32 | If there is a defined failure handler for the NodeRun, then this field is set to the id of the failure handler thread run. |
Message NodeRun
A NodeRun is a running instance of a Node in a ThreadRun. Note that a NodeRun
is a Getable object, meaning it can be retried from the LittleHorse grpc API.
Field | Label | Type | Description |
---|
id | | NodeRunId | The ID of the NodeRun. Note that the NodeRunId contains the WfRunId, the ThreadRun's number, and the position of the NodeRun within that ThreadRun. |
wf_spec_id | | WfSpecId | The ID of the WfSpec that this NodeRun is from. This is not always the same as the ThreadRun it belongs to because of the upcoming WfSpec Version Migration feature. |
failure_handler_ids | repeated | int32 | A list of all ThreadRun's that ran to handle a failure thrown by this NodeRun. |
status | | LHStatus | The status of this NodeRun. |
arrival_time | | google.protobuf.Timestamp | The time the ThreadRun arrived at this NodeRun. |
end_time | optional | google.protobuf.Timestamp | The time the NodeRun was terminated (failed or completed). |
thread_spec_name | | string | The name of the ThreadSpec to which this NodeRun belongs. |
node_name | | string | The name of the Node in the ThreadSpec that this NodeRun belongs to. |
error_message | optional | string | A human-readable error message intended to help developers diagnose WfSpec problems. |
failures | repeated | Failure | A list of Failures thrown by this NodeRun. |
task | oneof node_type | TaskNodeRun | Denotes a TASK node, which runs a TaskRun. |
external_event | oneof node_type | ExternalEventNodeRun | An EXTERNAL_EVENT node blocks until an ExternalEvent arrives. |
entrypoint | oneof node_type | EntrypointRun | An ENTRYPOINT node is the first thing that runs in a ThreadRun. |
exit | oneof node_type | ExitRun | An EXIT node completes a ThreadRun. |
start_thread | oneof node_type | StartThreadRun | A START_THREAD node starts a child ThreadRun. |
wait_threads | oneof node_type | WaitForThreadsRun | A WAIT_THREADS node waits for one or more child ThreadRun's to complete. |
sleep | oneof node_type | SleepNodeRun | A SLEEP node makes the ThreadRun block for a certain amount of time. |
user_task | oneof node_type | UserTaskNodeRun | A USER_TASK node waits until a human executes some work and reports the result. |
start_multiple_threads | oneof node_type | StartMultipleThreadsRun | A START_MULTIPLE_THREADS node iterates over a JSON_ARR variable and spawns a child ThreadRun for each element in the list. |
throw_event | oneof node_type | ThrowEventNodeRun | A THROW_EVENT node throws a WorkflowEvent of a specified WorkflowEventDef. |
wait_for_condition | oneof node_type | WaitForConditionRun | A WAIT_FOR_CONDITION node blocks the ThreadRun until the specified condition evaluates to True. |
Message SleepNodeRun
The sub-node structure for a SLEEP NodeRun.
Field | Label | Type | Description |
---|
maturation_time | | google.protobuf.Timestamp | The time at which the NodeRun is SCHEDULED TO wake up. In rare cases, if the LH Server is back-pressuring clients due to extreme load, the timer event which marks the sleep node as "matured" may come in slightly late. |
matured | | bool | Whether the SleepNodeRun has been matured. |
Message StartMultipleThreadsRun
The sub-node structure for a START_MULTIPLE_THREADS NodeRun.
Note: the output of this NodeRun, which can be used to mutate Variables,
is a JSON_ARR variable containing the ID's of all the child threadRuns.
Field | Label | Type | Description |
---|
thread_spec_name | | string | The thread_spec_name of the child thread_runs. |
child_thread_ids | repeated | int32 | The list of all created child ThreadRun's |
Message StartThreadRun
The sub-node structure for a START_THREAD NodeRun.
Field | Label | Type | Description |
---|
child_thread_id | optional | int32 | Contains the thread_run_number of the created Child ThreadRun, if it has been created already. |
thread_spec_name | | string | The thread_spec_name of the child thread_run. |
Message TaskNodeRun
The sub-node structure for a TASK NodeRun.
Field | Label | Type | Description |
---|
task_run_id | optional | TaskRunId | The ID of the TaskRun. Note that if the ThreadRun was halted when it arrived at this TASK Node, then the task_run_id will be unset. |
Message ThrowEventNodeRun
The sub-node structure for a THROW_EVENT NodeRun.
Field | Label | Type | Description |
---|
workflow_event_id | | WorkflowEventId | The ID of the WorkflowEvent that was thrown by this ThrowEventNodeRun . |
Message UserTaskNodeRun
The sub-node structure for a USER_TASK NodeRun.
Field | Label | Type | Description |
---|
user_task_run_id | optional | UserTaskRunId | The ID of the UserTaskRun. Note that if the ThreadRun was halted when it arrived at this USER_TASK node, then the user_task_run_id will be unset. |
Message WaitForConditionRun
The sub-node structure for a WAIT_FOR_CONDITION NodeRun
Message WaitForThreadsRun
The sub-node structure for a WAIT_FOR_THREADS NodeRun.
Message WaitForThreadsRun.WaitForThread
A 'WaitForThread' structure defines a thread that is being waited for.
Field | Label | Type | Description |
---|
thread_end_time | optional | google.protobuf.Timestamp | The time at which the ThreadRun ended (successfully or not). Not set if the ThreadRun is still RUNNING, HALTED, or HALTING. |
thread_status | | LHStatus | The current status of the ThreadRun being waited for. |
thread_run_number | | int32 | The number of the ThreadRun being waited for. |
waiting_status | | WaitForThreadsRun.WaitingThreadStatus | The "waiting status" of this specific thread: whether it's still running, already done, handling a failure, or completely failed. |
failure_handler_thread_run_id | optional | int32 | If there is a failure on the ThreadRun, and we have a failure handler defined for it, then we will start a failure handler for this threadrun. This field is the id of that threadRun. |
Message ExternalEventDefId
ID for ExternalEventDef
Field | Label | Type | Description |
---|
name | | string | ExternalEventDef's are uniquedly identified by their name. |
Message ExternalEventId
ID for an ExternalEvent.
Field | Label | Type | Description |
---|
wf_run_id | | WfRunId | WfRunId for the ExternalEvent. Note that every ExternalEvent is associated with a WfRun. |
external_event_def_id | | ExternalEventDefId | The ExternalEventDef for this ExternalEvent. |
guid | | string | A unique guid allowing for distinguishing this ExternalEvent from other events of the same ExternalEventDef and WfRun. |
Message NodeRunId
ID for a NodeRun.
Field | Label | Type | Description |
---|
wf_run_id | | WfRunId | ID of the WfRun for this NodeRun. Note that every NodeRun is associated with a WfRun. |
thread_run_number | | int32 | ThreadRun of this NodeRun. Note that each NodeRun belongs to a ThreadRun. |
position | | int32 | Position of this NodeRun within its ThreadRun. |
Message PrincipalId
ID for a Principal.
Field | Label | Type | Description |
---|
id | | string | The id of this principal. In OAuth, this is the OAuth Client ID (for machine principals) or the OAuth User Id (for human principals). |
Message ScheduledWfRunId
ID for a ScheduledWfRun
Field | Label | Type | Description |
---|
id | | string | |
Message TaskDefId
ID for a TaskDef.
Field | Label | Type | Description |
---|
name | | string | TaskDef's are uniquely identified by their name. |
Message TaskDefMetricsId
ID for a specific window of TaskDef metrics.
Field | Label | Type | Description |
---|
window_start | | google.protobuf.Timestamp | The timestamp at which this metrics window starts. |
window_type | | MetricsWindowLength | The length of this window. |
task_def_id | | TaskDefId | The TaskDefId that this metrics window reports on. |
Message TaskRunId
ID for a TaskRun.
Field | Label | Type | Description |
---|
wf_run_id | | WfRunId | WfRunId for this TaskRun. Note that every TaskRun is associated with a WfRun. |
task_guid | | string | Unique identifier for this TaskRun. Unique among the WfRun. |
Message TaskWorkerGroupId
ID for a TaskWorkerGroup.
Field | Label | Type | Description |
---|
task_def_id | | TaskDefId | TaskWorkerGroups are uniquely identified by their TaskDefId. |
Message TenantId
ID for a Tenant.
Field | Label | Type | Description |
---|
id | | string | The Tenant ID. |
Message UserTaskDefId
ID for a UserTaskDef
Field | Label | Type | Description |
---|
name | | string | The name of a UserTaskDef |
version | | int32 | Note that UserTaskDef's use simple versioning. |
Message UserTaskRunId
ID for a UserTaskRun
Field | Label | Type | Description |
---|
wf_run_id | | WfRunId | WfRunId for this UserTaskRun. Note that every UserTaskRun is associated with a WfRun. |
user_task_guid | | string | Unique identifier for this UserTaskRun. |
Message VariableId
Id for a Variable.
Field | Label | Type | Description |
---|
wf_run_id | | WfRunId | WfRunId for the variable. Note that every Variable is associated with a WfRun. |
thread_run_number | | int32 | Each Variable is owned by a specific ThreadRun inside the WfRun it belongs to. This is that ThreadRun's number. |
name | | string | The name of the variable. |
Message WfRunId
ID for a WfRun
Field | Label | Type | Description |
---|
id | | string | The ID for this WfRun instance. |
parent_wf_run_id | optional | WfRunId | A WfRun may have a parent WfRun. If so, this field is set to the parent's ID. |
Message WfSpecId
The ID of a WfSpec.
Field | Label | Type | Description |
---|
name | | string | Name of the WfSpec. |
major_version | | int32 | Major Version of a WfSpec.
Note that WfSpec's are versioned. Creating a new WfSpec with the same name and no breaking changes to the public Variables API results in a new WfSpec being created with the same MajorVersion and a new revision. Creating a WfSpec with a breaking change to the public Variables API results in a new WfSpec being created with the same name, an incremented major_version, and revision = 0. |
revision | | int32 | Revision of a WfSpec.
Note that WfSpec's are versioned. Creating a new WfSpec with the same name and no breaking changes to the public Variables API results in a new WfSpec being created with the same MajorVersion and a new revision. Creating a WfSpec with a breaking change to the public Variables API results in a new WfSpec being created with the same name, an incremented major_version, and revision = 0. |
Message WfSpecMetricsId
ID for a specific window of WfSpec metrics.
Field | Label | Type | Description |
---|
window_start | | google.protobuf.Timestamp | The timestamp at which this metrics window starts. |
window_type | | MetricsWindowLength | The length of this window. |
wf_spec_id | | WfSpecId | The WfSpecId that this metrics window reports on. |
Message WorkflowEventDefId
ID for a WorkflowEventDef.
Field | Label | Type | Description |
---|
name | | string | The name of the WorkflowEventDef |
Message WorkflowEventId
An ID for a WorkflowEvent.
Field | Label | Type | Description |
---|
wf_run_id | | WfRunId | The Id of the WfRun that threw the event. |
workflow_event_def_id | | WorkflowEventDefId | The ID of the WorkflowEventDef that this WorkflowEvent is a member of. |
number | | int32 | A sequence number that makes the WorkflowEventId unique among all WorkflowEvent's of the same type thrown by the WfRun. This field starts at zero and is incremented every time a WorkflowEvent of the same type is thrown by the same WfRun. |
Message ScheduledWfRun
A ScheduledWfRun
is an object in the LittleHorse API that triggers a WfRun
to be started
on a cron schedule.
Field | Label | Type | Description |
---|
id | | ScheduledWfRunId | Unique id for this ScheduledWfRun. |
wf_spec_id | | WfSpecId | WfSpec used to run a workflow on a schedule. |
variables | map | ScheduledWfRun.VariablesEntry | A map from Variable Name to Values for those variables. The provided variables are passed as input to the Entrypoint ThreadRun. |
parent_wf_run_id | optional | WfRunId | Parent WfRunId associated with all the generated WfRuns |
cron_expression | | string | UNIX expression used to specify the schedule for executing WfRuns |
created_at | | google.protobuf.Timestamp | Creation time for this ScheduledWfRun |
Message ScheduledWfRun.VariablesEntry
Message AwaitWorkflowEventRequest
Request to await until a WorkflowEvent of a certain WorkflowEventDef on a certain WfRun
is thrown. Relies upon native GRPC deadlines to configure timeouts.
Field | Label | Type | Description |
---|
wf_run_id | | WfRunId | The ID of the WfRun which must throw the WorkflowEvent. |
event_def_ids | repeated | WorkflowEventDefId | The IDs of the WorkflowEventDef that must be thrown. The request will return the first matching WorkflowEvent thrown. If event_def_ids is empty, then the request will return the first WorkflowEvent thrown by the WfRun. |
workflow_events_to_ignore | repeated | WorkflowEventId | Since a single WfRun may throw multiple WorkflowEvent's with the same WorkflowEventDefId, it is necessary to provide a client the ability to "ignore" WorkflowEvent's that have already been 'awaited'. Any WorkflowEvent specified by this field is ignored by the rpc. |
Message DeleteExternalEventDefRequest
Deletes an ExternalEventDef
Message DeleteExternalEventRequest
Deletes an ExternalEvent.
Field | Label | Type | Description |
---|
id | | ExternalEventId | The ID of the ExternalEvent to delete. |
Message DeleteScheduledWfRunRequest
Delete an existing ScheduledWfRun, returns INVALID_ARGUMENT if object does not exist
Field | Label | Type | Description |
---|
id | | ScheduledWfRunId | Id of the ScheduledWfRun to be deleted |
Message DeleteTaskDefRequest
Deletes a TaskDef.
Field | Label | Type | Description |
---|
id | | TaskDefId | The ID of the TaskDef to delete. |
Message DeleteUserTaskDefRequest
Deletes a UserTaskDef.
Field | Label | Type | Description |
---|
id | | UserTaskDefId | The ID of the UserTaskDef to delete. |
Message DeleteWfRunRequest