Skip to content

Commit 1c1292b

Browse files
Add $.flow.trigger (#13997)
* add alpha $.flow.trigger * minor details * remove from python docs * format and add to troubleshooting * remove javascript in code formatting
1 parent 48c9061 commit 1c1292b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs-v2/pages/code/nodejs/index.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,27 @@ In general, if you just need to make an HTTP request but don't care about the re
352352

353353
You can return HTTP responses from [HTTP-triggered workflows](/workflows/steps/triggers/#http) using the [`$.respond()` function](/workflows/steps/triggers/#http-responses).
354354

355+
## Invoke another workflow
356+
357+
<Callout type="warning">
358+
This is an alpha feature and is subject to change without prior notice.
359+
</Callout>
360+
361+
You can invoke another workflow in your workspace with `$.flow.trigger`:
362+
363+
```
364+
await $.flow.trigger(
365+
workflowId, // your Pipedream workflow ID, e.g. p_abc123
366+
payload, // any JSON-serializable data
367+
)
368+
```
369+
370+
[Find your workflow's ID here.](/troubleshooting#where-do-i-find-my-workflows-id)
371+
372+
This invokes the workflow directly -- you don't need to configure a trigger, and the request does not leave the platform.
373+
374+
We also provide a [Trigger Workflow](https://pipedream.com/apps/helper-functions/actions/trigger-workflow) action in the [Helper Functions](https://pipedream.com/apps/helper-functions) app so you don't need to do it by code!
375+
355376
## Ending a workflow early
356377

357378
<VideoPlayer title="Conditionally run Workflows" src="https://www.youtube.com/embed/sajgIH3dG58" startAt="205" />

docs-v2/pages/troubleshooting.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ https://pipedream.com/@dylburger/p_abc123/edit
6262

6363
Your workflow's ID is the value that starts with `p_`. In this example: `p_abc123`.
6464

65+
## How do I invoke another workflow?
66+
67+
We provide a [Trigger Workflow](https://pipedream.com/apps/helper-functions/actions/trigger-workflow) action in the [Helper Functions](https://pipedream.com/apps/helper-functions) app. [See more here](/code/nodejs#invoke-another-workflow).
68+
69+
Another option is to make an HTTP request to a Pipedream HTTP webhook trigger.
70+
6571
## Where do I find my event source's ID?
6672

6773
Open [https://pipedream.com/sources](https://pipedream.com/sources) and click on your event source. Copy the URL that appears in your browser's address bar. For example:

0 commit comments

Comments
 (0)