temporalio / temporalio/features

[Feature request] Idempotency token for activity

Open
#677 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
32
Forks
28
Avg merge
1d 9h
Merged PRs (30d)
7

Description

Hi 👋

One common issue that I see engineering having with using Cadence is ensuring idempotent execution of your activities. Basically in case of a failure your activity should not produce any new side-effects upon retry. This is normally achieved by persisting some sort of state in your datastore and checking with it before perming an activity.

Basically right now there isn't an identifier that uniquely identifies a specific activity (activityId is only unique per workflow and runId / workflowId is the same for all activities within a workflow).

Generating these from the workflow would mean adding lots of markers and passing them to every activity. Right now I'm using UUIDv5(runId, activityId) from an activity to generate that identifier.

By all means this can be considered a business logic and should be implemented on top of your implementation, but it would be very handy to have at the Cadence level and should make it easier for engineers to implement it properly.

Contributor guide

No contributing guide indexed for this repository

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

No files, tests, or entry points are named. Start by reviewing how activityId, runId, and workflowId are exposed during activity execution, then define the required uniqueness and retry behavior; done means the request has an agreed implementation scope and validation criteria.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.