--- name: develop-{{name}} description: Run, extend, and deploy the {{name}} Temporal workflow app — local loop, adding workflows/activities, and the deploy path. --- # Developing {{name}} ## Run locally (zero cloud access) ```bash mesh start # local Mesh platform (Hub at http://localhost:9000) pnpm install mesh dev # api + worker in tmux, wired to the local platform ``` Prove it: `curl -s -X POST http://localhost:3000/workflows/greet -H 'content-type: application/json' -d '{"name":"Mesh"}'` → `{"result":"Hello, Mesh!"}`. Inspect runs in the Hub (http://localhost:9000) or at http://localhost:8233/namespaces/{{tenant}}-dev-{{name}}/workflows (per-app Temporal namespace, same as deployed). ## Add a workflow 1. Define the deterministic function in `worker/src/workflows.ts` (no `Date.now()`/`Math.random()`/IO — use `proxyActivities`). 2. Side effects go in `worker/src/activities.ts`. 3. Expose it from the API (`api/src/index.ts`): `client.workflow.start("yourWorkflow", { taskQueue: TEMPORAL_TASK_QUEUE, … })`. 4. `mesh dev restart worker` picks up the new code; re-curl to verify. ## Deploy ```bash mesh login {{tenant}}.dev mesh deploy up --yes ``` Never call `pulumi`/`aws`/`kubectl` directly — every operation has a `mesh` command, and failures name their fix.