temporalio / temporalio/temporal

[Interpreter Proposal] New way to write workflow using Temporal

Open
#2,685 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Background

The main problem of this technology is that it requires developers to write code to be replayable. This is against the existing pattern of human programming.
Most people don't know their code must be replayable. On the other hand, software must be soft. We have to change code all the time for business changes and new requirements.
These two factors together have made things extremely difficult for engineers to use Temporal.

Proposal

Instead of writing the Temporal workflow, we let users write workflow in code by defining a set of WorkflowState.
Each WorkflowState defines two things: requestPrecondition and decideNextStates
requestPrecondition will request for signals, timers, activity, etc
When all/any precondition is met, the decideNextStates is invoked to get the next states to jump into.

To make this idea work, we build one Temporal workflow for everyone so that they don't need to write their Temporal workflow.
This workflow will call requestPrecondition and decideNextStates using Temporal activities, so that those user workflow code is always replay safe.

In another way to think about it, this is a Codable version of StepFunctions which is built on top of Temporal.

It preserves all most the full power of Temporal like

  • Reset workflow
  • Search Attributes
  • Writing unit tests for workflow code(which is super hard for StepFunctions)
  • etc

And there is no need to worry about non-deterministic errors.

Limitation

  • We may lose some readability of the workflow code
  • We will lose some flexibility of mutating internal workflow states compared to native Temporal workflow code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Temporal's replay-safety model and the proposed WorkflowState abstraction, including requestPrecondition and decideNextStates. The issue does not name files, tests, or an implementation entry point; completion would require an agreed design or prototype scope before coding.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.