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