feat(remote-workflow): add durable remote workflow handlers - #223
Open
lucamaraschi wants to merge 1 commit into
Open
lucamaraschi wants to merge 1 commit into
lucamaraschi wants to merge 1 commit into
Conversation
Signed-off-by: Luca Maraschi <luca.maraschi@gmail.com>
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR2 — Platformatic World
Title
feat(remote-workflow): add durable remote workflow handlersBody
Summary
Adds
@platformatic/remote-workflowto Platformatic World.This package provides the application-facing API and framework-neutral runtime
for invoking a named Workflow SDK workflow from another Workflow SDK workflow.
The complete flow is:
remote(endpoint, input).operation key.
endpoint-to-workflow mapping private.
control plane.
World remains the durable source of truth for caller operations, deadlines,
handler runs, and terminal outcomes. The control plane is used for discovery,
leasing, and delivery coordination.
Workflow-to-workflow example
Caller workflow:
Handler workflow:
Handler declaration:
The caller does not know the handler's private Workflow SDK workflow ID. It
only uses the stable endpoint name and public schemas.
Included functionality
remote(endpoint, input, options)caller APIdefineRemote()handler declarationsremote.tsplatformatic-remote-workflowCLIonAfterBundleintegration helpercancellation, and bounded result delivery
Build-time behavior
The package can be used directly through its build API or CLI.
For automatic generation, the completed Workflow SDK manifest is consumed from
the
onAfterBundlelifecycle boundary. The generated artifacts are:remote-manifest.json: public endpoint names and schemasremote-handlers.json: private endpoint-to-workflow-ID mappingA missing
remote.tsproduces a caller-only application and does not start ahandler runtime.
Runtime boundaries
This package owns the remote workflow protocol and World integration. It does
not own:
Those responsibilities are supplied by the host capability and control-plane
adapter.
Dependencies
onAfterBundlerequires PR #3751.@platformatic/workflowsdkto merge.Verification
eslint packages/remote-workflow/src packages/remote-workflow/test tsc -p packages/remote-workflow/tsconfig.types.json tsc -p packages/remote-workflow/tsconfig.json node --test packages/remote-workflow/test/*.test.tsResults: