Skip to content

Commit

Permalink
feat(server): Add source NodeRunId field to WorkflowEvent object (#1175)
Browse files Browse the repository at this point in the history
Enables users to trace down the source NodeRun for any given WorkflowEvent by indexing the `node_run_id` field.
  • Loading branch information
Snarr authored Dec 10, 2024
1 parent e3bbe4a commit e3e4e7b
Show file tree
Hide file tree
Showing 14 changed files with 355 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ export const WorkflowEventDef: FC<Props> = ({ spec }) => {
<LinkWithTenant
className="py-2 text-blue-500 hover:underline"
target="_blank"
// TODO: Add node highlighting
// href={`/wfRun/${concatWfRunIds(workflowEvent.id?.wfRunId!)}?threadRunNumber=${workflowEvent.threadRunNumber}&nodeRunName=${workflowEvent.nodeRunPosition}-${spec.id?.name}-WORKFLOW_EVENT`}
href={`/wfRun/${concatWfRunIds(workflowEvent.id?.wfRunId!)}`}
href={`/wfRun/${concatWfRunIds(workflowEvent.id?.wfRunId!)}?threadRunNumber=${workflowEvent.nodeRunId?.threadRunNumber}&nodeRunName=${workflowEvent.nodeRunId?.position}-throw-${spec.id?.name}-THROW_EVENT`}
>
{concatWfRunIds(workflowEvent.id?.wfRunId!)}
</LinkWithTenant>
Expand Down
1 change: 1 addition & 0 deletions docs/docs/08-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4033,6 +4033,7 @@ world.
| `id` | | [WorkflowEventId](#workfloweventid) | The ID of the WorkflowEvent. Contains WfRunId and WorkflowEventDefId. |
| `content` | | [VariableValue](#variablevalue) | The content of the WorkflowEvent. |
| `created_at` | | google.protobuf.Timestamp | The time that the WorkflowEvent was created. |
| `node_run_id` | | [NodeRunId](#noderunid) | The NodeRun with which the WorkflowEvent is associated. |
<!-- end Fields -->
<!-- end HasFields -->

Expand Down
3 changes: 3 additions & 0 deletions schemas/littlehorse/workflow_event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ message WorkflowEvent {

// The time that the WorkflowEvent was created.
google.protobuf.Timestamp created_at = 3;

// The NodeRun with which the WorkflowEvent is associated.
NodeRunId node_run_id = 4;
}

// The WorkflowEventDef defines the blueprint for a WorkflowEvent.
Expand Down
71 changes: 43 additions & 28 deletions sdk-go/lhproto/workflow_event.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e3e4e7b

Please sign in to comment.