(workflow: Workflow.Any)
| 615 | const payloadParentKey = "~@effect/workflow/parent" as const |
| 616 | |
| 617 | const 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 | |
| 641 | const ExitUnknown = Schema.Exit({ |
| 642 | success: Schema.Unknown, |
no test coverage detected