A Temporal-to-Cloud-Run migration should pass five groups of tests: workflow parity and replay, state and in-flight workflow checks, load and scaling tests, failure and recovery drills, and observability plus cost validation. Passing all five shows that your workflows behave the same, survive disruption, and run at a cost you can defend.
The reason for this breadth is that Cloud Run changes how your Temporal workers run, not what your workflows do. Workers become container instances that scale up and down, so you must prove that determinism, concurrency, and spend all hold under that new model. The sections below walk through each test group and the go or no-go criteria that tie them together.
Which tests prove workflow parity after migration?
Workflow parity tests prove that the same inputs produce the same outputs, the same event history, and the same side effects on Cloud Run as on your current workers. Temporal workflow replay testing is the strongest of these, because it re-executes recorded histories against your new worker code and flags any divergence.
Run these checks before you move any live traffic:
- Replay tests: Export a representative set of workflow histories from production and replay them against the build you will deploy to Cloud Run. Any non-determinism error means the code or its dependencies changed behavior.
- Workflow determinism testing: Check for time, random, and map iteration usage, plus library upgrades bundled into the new container image. A base image change can alter behavior without a single line of workflow code changing.
- Activity contract tests: Confirm that each activity returns identical results, error types, and retry behavior when it runs from Cloud Run, including network paths, credentials, and timeouts.
- Side-by-side runs: Execute the same test workflows on old and new workers in a staging namespace and compare results.
Cover every workflow type, every signal and query handler, and every version branch created with patching or worker versioning. Histories with long timers and child workflows deserve extra attention, since they exercise the most code paths.
How do you test state and in-flight workflows?
You test state and in-flight workflows by starting long-running workflows on the old workers, switching task queue polling to Cloud Run workers mid-execution, and confirming that every workflow resumes from its last event without losing data or repeating completed work. Temporal holds state in its service, so correctness depends on replay, not on the worker.
What should a mid-flight handover test include?
Create workflows in several states: waiting on a timer, waiting on a signal, running an activity, and awaiting a child workflow. Then stop the old workers and let Cloud Run workers take over. Check that timers fire on schedule, signals deliver once, and activities that were already scheduled do not execute twice unless your retry policy says they should.
How do you check data integrity and versioning?
Verify that payload converters, encryption codecs, and search attributes behave identically on the new workers. A mismatched data converter turns healthy histories into unreadable ones. Also confirm your versioning strategy: workflows started on the old build must keep running on compatible code, and the pinned versions must exist on Cloud Run before cutover.
What load and scaling tests should Cloud Run pass?
Cloud Run workers should pass load tests that match your peak workflow start rate, activity throughput, and task queue backlog, while autoscaling keeps schedule-to-start latency within your target. Cloud Run load testing for Temporal focuses on how fast instances scale, not just on raw request volume.
Include these scenarios in your plan:
- Steady peak load: Sustain your highest expected workflow starts per second and measure activity completion rates and task queue latency.
- Burst load: Spike traffic sharply and watch how quickly new instances come online and drain the backlog.
- Scale to zero and cold start: If you allow idle instances to scale down, measure the delay before polling resumes. Set a minimum instance count where that delay breaks your latency targets.
- Concurrency limits: Tune worker concurrency settings against Cloud Run CPU and memory limits so instances neither starve nor sit idle.
- Long-running activities: Confirm that request timeouts, CPU allocation settings, and heartbeats work for activities that run for minutes or hours.
Remember that Temporal workers poll for tasks rather than receive requests. Configure Cloud Run so that instances stay allocated CPU while polling, and base autoscaling on a signal that reflects task queue backlog rather than HTTP traffic alone.
How should failure and recovery be tested?
Failure and recovery testing proves that workflows complete correctly when instances crash, deployments roll out, dependencies fail, or the network drops. Inject these faults deliberately in staging and confirm that Temporal retries, timeouts, and history replay restore progress without data loss or duplicate side effects.
Run at least these drills:
- Instance termination: Kill Cloud Run instances during activity execution and confirm that the activity retries on another instance.
- Rolling deployment: Deploy a new revision while workflows run and verify that old and new revisions coexist safely.
- Dependency outages: Block a database or downstream API and check that retry policies, backoff, and non-retryable error handling behave as designed.
- Temporal service connectivity loss: Interrupt the connection to your Temporal cluster and confirm that workers reconnect and resume polling without manual action.
- Idempotency checks: Confirm that every activity with external effects tolerates being run more than once.
- Rollback rehearsal: Practice returning traffic to the old workers and confirm that workflows started on Cloud Run still complete.
Which observability and cost checks come before cutover?
Before cutover, you need dashboards, alerts, and traces that show workflow health on Cloud Run, plus a validated cost model for the new setup. Observability proves you can detect problems quickly. Cost validation proves the migration delivers the financial outcome you expected rather than a surprise bill.
What observability should be in place?
Confirm that you can see task queue backlog, schedule-to-start latency, workflow failure and retry rates, worker instance counts, and container CPU and memory. Check that logs carry workflow and run IDs, that traces connect activities to downstream calls, and that alerts page the right team. Test those alerts by triggering them on purpose.
How do you validate cost before going live?
Run your load tests long enough to extrapolate monthly spend from instance hours, CPU, memory, requests, and network egress. Compare that figure against the current infrastructure cost and against your business case. Check that labels or tags allocate Cloud Run spend to the right team and workflow, and set budget alerts. A solid FinOps approach to cloud migration cost validation gives you the ownership, allocation, and forecasting habits to keep that spend under control after launch.
What criteria decide a go or no-go cutover?
Go when every test group meets its pre-agreed threshold, your rollback path works, and owners have signed off on risk and cost. Declare no-go when any replay test fails, any in-flight workflow loses state, or latency and spend miss their targets without a mitigation you can ship quickly.
Use a written migration cutover checklist with measurable gates:
- 100 percent of sampled production histories replay without determinism errors.
- In-flight workflows complete correctly across the worker handover in staging.
- Peak and burst load tests keep schedule-to-start latency inside your service level targets.
- Every failure drill ends with workflows recovering and no duplicate side effects.
- Dashboards and alerts work, and the on-call team has practiced the runbook.
- Projected monthly cost falls within the approved budget, with spend allocated to owners.
- A tested rollback plan exists, with a named person who can trigger it.
Consider a phased cutover: shift one task queue or a small share of new workflows first, watch the metrics, then expand. This limits the blast radius and gives you real production data before you commit fully. If the migration is part of a wider change program, aligning it with your strategic portfolio management keeps the cutover tied to business priorities and funding.
How we help with a Temporal-to-Cloud-Run migration
We help you prove that the migration delivers business value, not just working code. Our teams connect engineering decisions to cost, risk, and outcomes, so your go or no-go call rests on facts you all trust.
- Cost modeling before cutover: We build forecasts of Cloud Run spend from your load test data and compare them with your current run costs.
- Cost allocation and ownership: We set up tagging, allocation, and accountability so each team sees and owns what its workflows cost.
- Decision-ready reporting: We turn technical test results into clear criteria that finance, IT, and engineering can agree on.
- Ongoing optimization: We help you rightsize instances and review commitments after launch, so savings last beyond the migration.
- Cloud versus on-premises tradeoffs: Our combination of TBM and FinOps helps you weigh cost, performance, and risk across hosting options.
Want to see what your migration will cost and deliver before you cut over? Get in touch with us and we will help you plan it.