What the agent does
The agent reads the manifest and what it pins. In a project like temporalio/money-transfer-project-template-ts, package.json lists seven @temporalio/* packages at ~1.14.1, activity, client, common, envconfig, worker and workflow as dependencies and testing as a dev dependency, alongside mocha ^10.2.0 and nanoid 3.x. The dev dependencies are a 2023 snapshot: typescript ^4.9.5, eslint ^7.32.0 with @typescript-eslint 6.7.3 and eslint-plugin-deprecation, prettier 2.8.8, ts-node, nodemon ^2, @tsconfig/node18, and jest, ts-jest and @types/jest next to @types/mocha. .nvmrc says 18, tsconfig.json extends @tsconfig/node18, and package-lock.json is lockfile version 2. The scripts are build with tsc --build, lint with eslint src, and test, which runs mocha with ts-node/register over src/mocha/*.test.ts.
The tests are what make this upgrade checkable. src/mocha/workflows.test.ts starts TestWorkflowEnvironment.createLocal(), which downloads and runs the Temporal CLI dev server, creates a Worker with workflowsPath pointing at src/workflows.ts and either mocked activities or the real ones from src/activities.ts, and executes moneyTransfer four times: a success with mocked transaction ids, and three failures for a missing target account, a missing source account and an amount over the balance, each expected to surface as WorkflowFailedError. src/mocha/activities.test.ts runs withdraw and deposit in a MockActivityEnvironment. The workflow itself proxies the activities with a retry policy of 500 attempts and non-retryable InvalidAccountError and InsufficientFundsError, and compensates a failed deposit with refund.
The agent runs npm ci, npm run build, npm run lint and npm test first to record the baseline, then npm outdated. The Temporal SDK packages must move together, so it bumps all seven to the same newest 1.x and reads the SDK release notes between the two versions for anything the workflow or worker code touches, such as changes to proxyActivities options or envconfig. Minor and patch bumps for mocha, nanoid, nodemon, ts-node, prettier within 2.x and the type packages go in the same pass. Each group is followed by build, lint and test, and a bump that breaks one is reverted and recorded with the error.
Majors are held back and explained, not applied silently. typescript 5, eslint 9 with flat config, @typescript-eslint 8, prettier 3 and nodemon 3 each change configuration or output, and eslint-plugin-deprecation does not carry over to the ESLint 9 and typescript-eslint 8 line, which replaced it with a built-in rule. .nvmrc at 18 names a Node release past its end of life, and @tsconfig/node18 follows it. The agent also notes that jest, ts-jest and @types/jest are installed but no script runs them, since the tests are mocha, and that mocha sits in dependencies rather than devDependencies. Those observations go in the pull request as a follow-up list with the command to apply each, not as changes.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Upgrade the npm dependencies in this Temporal TypeScript project. Read package.json, package-lock.json, .nvmrc, tsconfig.json, .eslintrc.js and the tests under src/mocha first, then run npm ci, npm run build, npm run lint and npm test to record the baseline. Run npm outdated. Bump every @temporalio package to the same newest 1.x release together and check the SDK release notes between the versions for anything the workflow, worker or client code uses. Apply minor and patch upgrades for the remaining dependencies. After each group run build, lint and test, and revert any bump that breaks them, recording the error. Do not apply major upgrades; list each held-back major with what it would require. Note dependencies that no script uses and dependencies placed in the wrong section. Open a pull request listing each bump with its old and new version and the test output.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
What comes back is a pull request that changes package.json and package-lock.json and nothing else: the seven @temporalio packages on one new version, the minor and patch bumps that passed, and no edits to src/. If an SDK release note required a one-line code change for the workflow or worker, that change is in the same pull request with the note quoted.
The description has three parts: a table of bumps with old and new versions, grouped by the order they were applied; the baseline and final npm run build, npm run lint and npm test output, including the mocha summary for the four workflow tests and three activity tests against the local test server; and a follow-up list of held-back majors with the reason for each and the unused jest packages. The full transcript is at GET /o/{org}/sessions/{id}/messages.
A reviewer checks the Temporal SDK version against the server version in production, since the SDK and server have a compatibility range, reads any code change the release notes forced, and merges. A follow-up message on the same session can take one item from the follow-up list, such as moving to ESLint 9, with node_modules still on disk.
Run it on every Monday morning
An automation in the Project with a schedule trigger, 0 9 * * 1 in UTC, runs this prompt once a week against the repository; a run that finds nothing outdated says so and opens no pull request. The automation has its own max_runs_per_hour cap. From your own server instead, a scheduled job sends POST /o/{org}/sessions with this body and a request_id that is a UUID v5 of the repository and the ISO week, so a rerun returns the run already started rather than a second pull request.
Put a webhook_url on the key for runs the key starts. When the turn ends your endpoint receives run.completed with session_url, reads the pull request link from the session and posts it where the team reviews dependency changes.
The use case this job follows, with its automation and trigger: Upgrade dependencies weekly.
Why run it on Rush?
A Temporal SDK upgrade is only safe when the workflow tests run, and running them means a local test server, a worker and a bundled workflow, which takes a laptop over for the duration. The agent does it in a sandbox with the repository's own npm test, bumps the SDK packages as a set, and reruns the suite after each group, so the pull request reflects what passed rather than what npm update printed.
The baseline and final test output are in the pull request and the whole transcript stays on the run, so a reviewer sees exactly which bump was tried, which was reverted and why. Several Temporal services can be upgraded in parallel, one sandbox each, one pull request each.
Frequently asked questions
Why do all the @temporalio packages move together?
They are released as one SDK and share internal types; a worker on one version and a client or workflow package on another can fail to compile or behave differently. The agent bumps the seven packages to one version and tests them as a set.
Does the test suite need a Temporal server?
It starts its own. TestWorkflowEnvironment.createLocal() downloads and runs the Temporal CLI dev server for the duration of the suite, so the sandbox needs network access and nothing else, and the production server is never touched.
Will it move to TypeScript 5 or ESLint 9?
Not in this run. Those are majors that change compiler behaviour and ESLint's configuration format, and eslint-plugin-deprecation does not carry over. They are listed in the pull request with what each would take; ask for one in a follow-up and the same session applies it.
What happens if a minor bump breaks the tests?
It is reverted and the error is recorded in the pull request under that package, with the failing test name. The remaining bumps still ship, so one awkward package does not block the rest of the week's upgrades.