diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index 0096dec333c59e..14261d42075d53 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -1321,7 +1321,6 @@ wrangler workflows instances terminate [OPTIONS] - `ID` - The ID of a Workflow instance. -{/* ### `instances pause` Pause (until resumed) a Workflow instance. @@ -1348,8 +1347,6 @@ wrangler workflows instances resume [OPTIONS] - `ID` - The ID of a Workflow instance. -*/} - ### `describe` ```sh @@ -1363,7 +1360,7 @@ wrangler workflows describe [OPTIONS] Trigger (create) a Workflow instance. ```sh -wrangler workflows describe [OPTIONS] +wrangler workflows trigger [OPTIONS] ``` - `WORKFLOW_NAME` @@ -1373,9 +1370,11 @@ wrangler workflows describe [OPTIONS] ```sh # Pass optional params to the Workflow. - wrangler workflows instances trigger my-workflow '{"hello":"world"}' + wrangler workflows trigger my-workflow '{"hello":"world"}' ``` +{/* + ### `delete` Delete (unregister) a Workflow. @@ -1387,6 +1386,8 @@ wrangler workflows delete [OPTIONS] - `WORKFLOW_NAME` - The name of a registered Workflow. +*/} + ## `tail` Start a session to livestream logs from a deployed Worker. diff --git a/src/content/docs/workflows/build/sleeping-and-retrying.mdx b/src/content/docs/workflows/build/sleeping-and-retrying.mdx index cdfaf298f75499..fc366956e04786 100644 --- a/src/content/docs/workflows/build/sleeping-and-retrying.mdx +++ b/src/content/docs/workflows/build/sleeping-and-retrying.mdx @@ -70,7 +70,7 @@ const defaultConfig: WorkflowStepConfig = { When providing your own `StepConfig`, you can configure: * The total number of attempts to make for a step -* The delay between attempts +* The delay between attempts (accepts both `number` (ms) or a human-readable format) * What backoff algorithm to apply between each attempt: any of `constant`, `linear`, or `exponential` * When to timeout (in duration) before considering the step as failed (including during a retry attempt) diff --git a/src/content/docs/workflows/build/trigger-workflows.mdx b/src/content/docs/workflows/build/trigger-workflows.mdx index 8efa29646664f7..1bd5cbe0ef5a60 100644 --- a/src/content/docs/workflows/build/trigger-workflows.mdx +++ b/src/content/docs/workflows/build/trigger-workflows.mdx @@ -62,20 +62,20 @@ interface Env { export default { async fetch(req: Request, env: Env) { - // - const instanceId = new URL(req.url).searchParams.get("instanceId") + // Get instanceId from query parameters + const instanceId = new URL(req.url).searchParams.get("instanceId") - // If an ?instanceId= query parameter is provided, fetch the status - // of an existing Workflow by its ID. - if (instanceId) { - let instance = await env.MY_WORKFLOW.get(instanceId); + // If an ?instanceId= query parameter is provided, fetch the status + // of an existing Workflow by its ID. + if (instanceId) { + let instance = await env.MY_WORKFLOW.get(instanceId); return Response.json({ status: await instance.status(), }); - } + } - // Else, create a new instance of our Workflow, passing in any (optional) params - // and return the ID. + // Else, create a new instance of our Workflow, passing in any (optional) + // params and return the ID. const newId = await crypto.randomUUID(); let instance = await env.MY_WORKFLOW.create({ id: newId }); return Response.json({ diff --git a/src/content/docs/workflows/get-started/guide.mdx b/src/content/docs/workflows/get-started/guide.mdx index 1a33b43d591c40..be08723dc17d85 100644 --- a/src/content/docs/workflows/get-started/guide.mdx +++ b/src/content/docs/workflows/get-started/guide.mdx @@ -507,6 +507,8 @@ curl -s https://workflows-starter.YOUR_WORKERS_SUBDOMAIN.workers.dev/ {"id":"16ac31e5-db9d-48ae-a58f-95b95422d0fa","details":{"status":"queued","error":null,"output":null}} ``` +{/* + ## 7. (Optional) Clean up You can optionally delete the Workflow, which will prevent the creation of any (all) instances by using `wrangler`: @@ -517,6 +519,8 @@ npx wrangler workflows delete my-workflow Re-deploying the Workers script containing your Workflow code will re-create the Workflow. +*/} + --- ## Next steps