---
name: diagrid-migrate-temporal
description: Rewrite Temporal workflows and activities as Dapr Workflows. Inventory the Temporal code, report what maps, then port one workflow at a time and check each port. Use for moving off Temporal or a Temporal-to-Dapr port. Java today.
---
# Migrate Temporal workflows to Dapr Workflows
Goal: each Temporal workflow the user picks is rewritten on the Dapr Workflow SDK, runs
on a real sidecar, and behaves the same as before, including when an activity fails.
A port that compiles and passes its happy-path test is not done: the differences that
matter here only show when something goes wrong.
Two files hold the facts. Read both before step 3:
- [reference/concept-map.md](reference/concept-map.md): every Temporal construct, its
Dapr equivalent, and the rule for porting it, by row ID (`T04`, `T21`, …).
- [reference/checklist.md](reference/checklist.md): the lines that fail a port, by ID
(`C01`, …).
## 1. Check the scope
Read the build files. This skill ports **Java** today.
| Found | Do |
| --- | --- |
| `io.temporal:temporal-sdk` in `pom.xml` or `build.gradle` | Continue |
| A Temporal SDK in another language | Stop. Say that only Java is covered so far, and that the concept map's rules still apply by hand |
| No Temporal SDK | Stop. This is not a migration: use the workflow scaffold skill |
If the user wants to keep their Temporal code and run it on Diagrid unchanged, this skill
is the wrong path. Say so in one line and stop.
## 2. Make it safe to change things
Ask for a clean working tree on a branch of its own. Never commit, push or delete
anything unless the user asks. Keep the Temporal code until the user says it can go: it
is the reference the port is checked against.
## 3. Take an inventory, without changing anything
<!-- ‹guest · 2026-12-04› -->
List, per workflow:
- the workflow interface and method, and the activities it calls
- for each activity call: its `ActivityOptions`, especially timeouts and `RetryOptions`,
and whether it uses the default retry
- signals, queries and updates
- `Saga` use, `CancellationScope`, `Workflow.await`, `Workflow.getVersion`,
child workflows, continue-as-new, timers
- anything on the client side the workflow depends on: signal-with-start, ID reuse
policies, search attributes, schedules
- interceptors and custom data converters
## 4. Report, then wait for approval
Write the inventory as a report the user can approve. Group each finding:
| Group | Meaning |
| --- | --- |
| Maps directly | ✅ rows: port as is |
| Needs a pattern | 🟡 rows: name the rule from the concept map |
| Needs a person | ❌ rows, and 🟡 rows the map marks for manual review |
Every finding names its row, for example "`T04` — 6 activity calls rely on the default
retry". End with the order you propose to port in, simplest workflow first.
**Stop here until the user approves.** Do not start rewriting on a partial answer.
## 5. Port one workflow at a time
For the workflow the user picked:
- Follow the concept-map rule for each construct it uses.
- Keep its external contract: workflow name, input and output shapes, event names. Any
change needs the user's approval, asked before you make it.
- Add the Dapr Java SDK through `io.dapr:dapr-sdk-bom` and `io.dapr:dapr-sdk-workflows`,
and add `io.dapr:testcontainers-dapr` for the test.
- While the Temporal SDK stays in the same build, the two SDKs pull different gRPC
versions and the Temporal tests can break. Pin one gRPC version for both, then run the
Temporal tests again before going on.
- Write one integration test per workflow on a real sidecar. It checks the result and
<!-- ‹guest · 2026-12-04› -->
the order in which activities ran, and it makes one activity fail so retries and
compensation are exercised.
## 6. Check the port
1. Build it.
2. Go through every line of the checklist against the ported code. Report each line
that is true, with file and line.
3. Run the integration test.
The port is done when the build passes, no checklist line is true, and the test passes.
A checklist line the user decides to accept goes into `DAPR_MIGRATION.md` with their
reason. Then move to the next workflow.
## 7. Write `DAPR_MIGRATION.md`
At the root of the project:
- each workflow ported, with its test
- each gap that needed a workaround, with its row ID
- each item left for manual review
- the cut-over plan: running Temporal workflows cannot be moved, so each workflow type
drains on Temporal while new instances start on Dapr (`T36`)
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.