From 53da03b8a5091858c89e929bdd8eceb6dc415430 Mon Sep 17 00:00:00 2001 From: Andrew Chuang Date: Wed, 18 Sep 2024 17:33:34 -0300 Subject: [PATCH 1/5] add alpha $.flow.trigger --- docs-v2/pages/code/nodejs/index.mdx | 8 ++++++++ docs-v2/pages/code/python/index.mdx | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/docs-v2/pages/code/nodejs/index.mdx b/docs-v2/pages/code/nodejs/index.mdx index ae72b0295fe4f..5cf5b98828146 100644 --- a/docs-v2/pages/code/nodejs/index.mdx +++ b/docs-v2/pages/code/nodejs/index.mdx @@ -352,6 +352,14 @@ In general, if you just need to make an HTTP request but don't care about the re You can return HTTP responses from [HTTP-triggered workflows](/workflows/steps/triggers/#http) using the [`$.respond()` function](/workflows/steps/triggers/#http-responses). +## Invoke another workflow + + +This is an alpha feature and is subject to change without prior notice. + + +You can invoke another workflow in your workspace by running `await $.flow.trigger(workflowId, event)`, where event is an object containing the data to send to the workflow. Here's how you can [find your workflow's ID](/troubleshooting#where-do-i-find-my-workflows-id). This invocation remains within Pipedream — you don't need to configure a trigger, and the request does not leave the platform. + ## Ending a workflow early diff --git a/docs-v2/pages/code/python/index.mdx b/docs-v2/pages/code/python/index.mdx index a875ed96a7736..fcb137ae18bf9 100644 --- a/docs-v2/pages/code/python/index.mdx +++ b/docs-v2/pages/code/python/index.mdx @@ -126,6 +126,10 @@ Unlike the [Node.js equivalent](https://pipedream.com/docs/workflows/steps/trigg _Don't forget_ to [configure your workflow's HTTP trigger to allow a custom response](/workflows/steps/triggers/#http-responses). Otherwise your workflow will return the default response. +## Invoke another workflow + +This functionality is currently not supported in Python steps. However, you can invoke another workflow using Node.js steps. For more information, see [Invoke another workflow in Node.js](/code/nodejs#invoke-another-workflow). + ## Sharing data between steps A step can accept data from other steps in the same workflow, or pass data downstream to others. From 68c051b39ab7278b25b4df52ac923b57b3d67835 Mon Sep 17 00:00:00 2001 From: Andrew Chuang Date: Wed, 18 Sep 2024 18:27:19 -0300 Subject: [PATCH 2/5] minor details --- docs-v2/pages/code/nodejs/index.mdx | 2 +- docs-v2/pages/code/python/index.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-v2/pages/code/nodejs/index.mdx b/docs-v2/pages/code/nodejs/index.mdx index 5cf5b98828146..2182bc8e737f4 100644 --- a/docs-v2/pages/code/nodejs/index.mdx +++ b/docs-v2/pages/code/nodejs/index.mdx @@ -358,7 +358,7 @@ You can return HTTP responses from [HTTP-triggered workflows](/workflows/steps/t This is an alpha feature and is subject to change without prior notice. -You can invoke another workflow in your workspace by running `await $.flow.trigger(workflowId, event)`, where event is an object containing the data to send to the workflow. Here's how you can [find your workflow's ID](/troubleshooting#where-do-i-find-my-workflows-id). This invocation remains within Pipedream — you don't need to configure a trigger, and the request does not leave the platform. +You can invoke another workflow in your workspace by running `await $.flow.trigger(workflowId, event)`, where `event` is an object containing the data to send to the workflow. Here's how you can [find your workflow's ID](/troubleshooting#where-do-i-find-my-workflows-id). This invocation remains within Pipedream — you don't need to configure a trigger, and the request does not leave the platform. ## Ending a workflow early diff --git a/docs-v2/pages/code/python/index.mdx b/docs-v2/pages/code/python/index.mdx index fcb137ae18bf9..5e8b468abffe7 100644 --- a/docs-v2/pages/code/python/index.mdx +++ b/docs-v2/pages/code/python/index.mdx @@ -128,7 +128,7 @@ _Don't forget_ to [configure your workflow's HTTP trigger to allow a custom resp ## Invoke another workflow -This functionality is currently not supported in Python steps. However, you can invoke another workflow using Node.js steps. For more information, see [Invoke another workflow in Node.js](/code/nodejs#invoke-another-workflow). +This is currently not supported in Python steps. However, you can invoke another workflow using Node.js steps. For more information, see [Invoke another workflow in Node.js](/code/nodejs#invoke-another-workflow). ## Sharing data between steps From 56bad49265824ad34b4702d8de4156afc9360fb2 Mon Sep 17 00:00:00 2001 From: Andrew Chuang Date: Fri, 20 Sep 2024 16:50:40 -0300 Subject: [PATCH 3/5] remove from python docs --- docs-v2/pages/code/python/index.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs-v2/pages/code/python/index.mdx b/docs-v2/pages/code/python/index.mdx index 5e8b468abffe7..a875ed96a7736 100644 --- a/docs-v2/pages/code/python/index.mdx +++ b/docs-v2/pages/code/python/index.mdx @@ -126,10 +126,6 @@ Unlike the [Node.js equivalent](https://pipedream.com/docs/workflows/steps/trigg _Don't forget_ to [configure your workflow's HTTP trigger to allow a custom response](/workflows/steps/triggers/#http-responses). Otherwise your workflow will return the default response. -## Invoke another workflow - -This is currently not supported in Python steps. However, you can invoke another workflow using Node.js steps. For more information, see [Invoke another workflow in Node.js](/code/nodejs#invoke-another-workflow). - ## Sharing data between steps A step can accept data from other steps in the same workflow, or pass data downstream to others. From 9d13c0c35524138aa7f94e249b3819e4bd706245 Mon Sep 17 00:00:00 2001 From: Andrew Chuang Date: Fri, 20 Sep 2024 16:50:54 -0300 Subject: [PATCH 4/5] format and add to troubleshooting --- docs-v2/pages/code/nodejs/index.mdx | 15 ++++++++++++++- docs-v2/pages/troubleshooting.mdx | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs-v2/pages/code/nodejs/index.mdx b/docs-v2/pages/code/nodejs/index.mdx index 2182bc8e737f4..475a9e3cf36bd 100644 --- a/docs-v2/pages/code/nodejs/index.mdx +++ b/docs-v2/pages/code/nodejs/index.mdx @@ -358,7 +358,20 @@ You can return HTTP responses from [HTTP-triggered workflows](/workflows/steps/t This is an alpha feature and is subject to change without prior notice. -You can invoke another workflow in your workspace by running `await $.flow.trigger(workflowId, event)`, where `event` is an object containing the data to send to the workflow. Here's how you can [find your workflow's ID](/troubleshooting#where-do-i-find-my-workflows-id). This invocation remains within Pipedream — you don't need to configure a trigger, and the request does not leave the platform. +You can invoke another workflow in your workspace with `$.flow.trigger`: + +```javascript +await $.flow.trigger( + workflowId, // your Pipedream workflow ID, e.g. p_abc123 + payload, // any JSON-serializable data +) +``` + +[Find your workflow's ID here.](/troubleshooting#where-do-i-find-my-workflows-id) + +This invokes the workflow directly -- you don't need to configure a trigger, and the request does not leave the platform. + +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! ## Ending a workflow early diff --git a/docs-v2/pages/troubleshooting.mdx b/docs-v2/pages/troubleshooting.mdx index 3b236f6913c73..08b5c5c8456ee 100644 --- a/docs-v2/pages/troubleshooting.mdx +++ b/docs-v2/pages/troubleshooting.mdx @@ -62,6 +62,12 @@ https://pipedream.com/@dylburger/p_abc123/edit Your workflow's ID is the value that starts with `p_`. In this example: `p_abc123`. +## How do I invoke another workflow? + +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). + +Another option is to make an HTTP request to a Pipedream HTTP webhook trigger. + ## Where do I find my event source's ID? 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: From 3c2cb8fab3a8ac3755f96c345aa1017bb23d667d Mon Sep 17 00:00:00 2001 From: Andrew Chuang Date: Fri, 20 Sep 2024 16:55:14 -0300 Subject: [PATCH 5/5] remove javascript in code formatting --- docs-v2/pages/code/nodejs/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-v2/pages/code/nodejs/index.mdx b/docs-v2/pages/code/nodejs/index.mdx index 475a9e3cf36bd..0138814665d64 100644 --- a/docs-v2/pages/code/nodejs/index.mdx +++ b/docs-v2/pages/code/nodejs/index.mdx @@ -360,7 +360,7 @@ This is an alpha feature and is subject to change without prior notice. You can invoke another workflow in your workspace with `$.flow.trigger`: -```javascript +``` await $.flow.trigger( workflowId, // your Pipedream workflow ID, e.g. p_abc123 payload, // any JSON-serializable data