MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeWorkflowEntity

Function makeWorkflowEntity

packages/cluster/src/ClusterWorkflowEngine.ts:617–639  ·  view source on GitHub ↗
(workflow: Workflow.Any)

Source from the content-addressed store, hash-verified

615const payloadParentKey = "~@effect/workflow/parent" as const
616
617const makeWorkflowEntity = (workflow: Workflow.Any) =>
618 Entity.make(`Workflow/${workflow.name}`, [
619 Rpc.make("run", {
620 payload: {
621 ...workflow.payloadSchema.fields,
622 [payloadParentKey]: Schema.optional(Schema.Struct({
623 workflowName: Schema.String,
624 executionId: Schema.String
625 }))
626 },
627 primaryKey: () => "",
628 success: Workflow.Result({
629 success: workflow.successSchema,
630 error: workflow.errorSchema
631 })
632 })
633 .annotate(ClusterSchema.Persisted, true)
634 .annotate(ClusterSchema.Uninterruptible, true),
635
636 DeferredRpc,
637 ResumeRpc,
638 ActivityRpc
639 ]).annotateContext(workflow.annotations)
640
641const ExitUnknown = Schema.Exit({
642 success: Schema.Unknown,

Callers 1

ensureEntityFunction · 0.85

Calls 3

annotateContextMethod · 0.65
makeMethod · 0.65
annotateMethod · 0.65

Tested by

no test coverage detected