Skip to content

feat: add Effect-native client, contract, and worker packages#112

Open
bweis wants to merge 3 commits intobtravers:mainfrom
bweis:effect
Open

feat: add Effect-native client, contract, and worker packages#112
bweis wants to merge 3 commits intobtravers:mainfrom
bweis:effect

Conversation

@bweis
Copy link
Copy Markdown

@bweis bweis commented Feb 24, 2026

Introduces three new packages — @temporal-contract/contract-effect, @temporal-contract/client-effect, and @temporal-contract/worker-effect — providing a fully Effect-native alternative to the existing @swan-io/boxed-based stack

  • All client methods return Effect<T, E> with Data.TaggedError errors, enabling typed Effect.catchTag / Effect.catchTags pattern matching instead of result.match({ Ok, Error })
  • Activities are declared with declareActivitiesHandler / declareActivitiesHandlerWithLayer returning Effect<Output, ActivityError>, with optional Layer-based service injection via ManagedRuntime
  • Adds order-processing-worker-effect integration test example covering executeWorkflow, startWorkflow, getHandle, describe, schema validation errors, Effect.catchTag recovery, and payment failure handling
  • Docs site updated to include the three new packages in the API reference and copy pipeline

- Introduced a new packages for an Effect-native typed Temporal client,
  enabling seamless interaction with workflows using Effect's error
handling and type safety.
- Added necessary dependencies and configurations in package.json and
  pnpm-lock.yaml.
- Created initial structure including README, TypeScript configuration,
  and test setup.
- Implemented core functionality for executing and starting workflows
  with typed inputs and outputs.
- Added error handling classes for better error management in workflow
  execution.

This package serves as a foundational component for building
Effect-native applications with Temporal.
@bweis
Copy link
Copy Markdown
Author

bweis commented Feb 24, 2026

See: Effect-TS/effect#5986

@btravers
Copy link
Copy Markdown
Owner

Thank you for your contribution! I'm not deeply familiar with EffectTS, but providing an EffectTS version was actually something I had in mind for the future.

I have two questions though.

The first one is about the contract itself: right now the contract is agnostic of the scehma validation library used because it relies on Standard Schema, and I'm not sure this pattern can be followed with EffectTS. How would you approach that?

The second one is about the client and worker implementation. I think it would be valuable to have a reference implementation — the EffectTS version could be a good candidate for that — and then derive the other implementations from it. This way we'd share the core logic and guarantee a consistent feature set across all implementations.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants