You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workflows/build/events-and-parameters.mdx
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ When a Workflow is triggered, it can receive an optional event. This event can i
12
12
13
13
Events are a powerful part of a Workflow, as you often want a Workflow to act on data. Because a given Workflow instance executes durably, events are a useful way to provide a Workflow with data that should be immutable (not changing) and/or represents data the Workflow needs to operate on at that point in time.
14
14
15
-
## Pass parameters to a Workflow
15
+
## Pass data to a Workflow
16
16
17
17
You can pass parameters to a Workflow in three ways:
18
18
19
19
* As an optional argument to the `create` method on a [Workflow binding](/workers/wrangler/commands/#trigger) when triggering a Workflow from a Worker.
20
20
* Via the `--params` flag when using the `wrangler` CLI to trigger a Workflow.
21
-
* Via the `step.waitForEvent` API, which allows a Workflow instance to wait for an event (and optional data) to be received while it is running.
21
+
* Via the `step.waitForEvent` API, which allows a Workflow instance to wait for an event (and optional data) to be received _while it is running_.
22
22
23
23
You can pass any JSON-serializable object as a parameter.
Visit the [guide on sending data to Workflows] to learn about how to pass event data to a running Workflow, including via HTTP (webhooks) and/or Workers bindings.
*`options` - an object with properties for `type`, which determines which event type this `waitForEvent` call will match on when calling `instance.sendEvent`, and an optional `timeout` property, which defines how long the `waitForEvent` call will block for before throwing a timeout exception. The default timeout is 24 hours.
114
+
115
+
Review the documentation on [events and parameters](/workflows/build/events-and-parameters/) to learn how to send events to a running Workflow instance.
0 commit comments