From 99164ae0636b556a12f3c5dd33676bea91b19b75 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Thu, 5 Dec 2024 16:40:26 -0800 Subject: [PATCH 1/5] Update workflows.mdx --- docs-v2/pages/connect/workflows.mdx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs-v2/pages/connect/workflows.mdx b/docs-v2/pages/connect/workflows.mdx index d9d5a3abcc208..df99072736622 100644 --- a/docs-v2/pages/connect/workflows.mdx +++ b/docs-v2/pages/connect/workflows.mdx @@ -199,7 +199,7 @@ curl -X POST https://{your-endpoint-url} \ -## Step configuration +## Configuring workflow steps When configuring a workflow that's using your end user's auth instead of your own, you'll need to define most configuration fields manually in each step. @@ -237,7 +237,27 @@ curl -X POST https://{your-endpoint-url} \ We plan to improve this interface in the future, and potentially allow developers to store end user metadata and configuration data alongside the connected account for your end users, so you won't need to pass the data at runtime. -## Errors +## Testing workflow steps + +To test a step that uses the connected account of one of your end users in the builder, you'll need a few things to be configured so that your workflow knows which account to use for the test. + +**Make sure you have an external user with the relevant connected accounts saved to your project:** +- Go to the **[Users tab](/connect#users)** in the **Connect** section of your project to confirm +- If not, you can [easily connect one in the UI](#connect-a-test-account) + +**Pass the environment and external user ID:** +1. Once you've added an HTTP trigger to the workflow, click **Generate test event** +2. Click on the **Headers** tab +3. Make sure `x-pd-environment` is set (you'll likely want to `development`) +4. Make sure to also pass `x-pd-external-user-id` with the external user ID of the user you'd like to test with + +## Troubleshooting + + +To return verbose error messages to the caller, configure the HTTP trigger to **Return a custom response from your workflow**. + + +### Common errors #### No external user ID passed, but one or more steps require it - One or more steps in the workflow are configured to **Use end user's auth via Connect**, but no external user ID was passed when invoking the workflow. From b30d04334ef6b93dcf66a7bd9dfcc2fb4cf78744 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Dec 2024 15:13:50 -0800 Subject: [PATCH 2/5] Update workflows.mdx --- docs-v2/pages/connect/workflows.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs-v2/pages/connect/workflows.mdx b/docs-v2/pages/connect/workflows.mdx index df99072736622..005bac469b241 100644 --- a/docs-v2/pages/connect/workflows.mdx +++ b/docs-v2/pages/connect/workflows.mdx @@ -254,7 +254,10 @@ To test a step that uses the connected account of one of your end users in the b ## Troubleshooting -To return verbose error messages to the caller, configure the HTTP trigger to **Return a custom response from your workflow**. +For help debugging issues with your workflow, you can return verbose error messages to the caller by configuring the HTTP trigger to **Return a custom response from your workflow**. + +Configure custom response + ### Common errors From 04d3ed6a0bceac5d5e2d3c3fbc3e1d8b9e0b6b31 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Dec 2024 17:03:20 -0800 Subject: [PATCH 3/5] Update workflows.mdx --- docs-v2/pages/connect/workflows.mdx | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/docs-v2/pages/connect/workflows.mdx b/docs-v2/pages/connect/workflows.mdx index 005bac469b241..d3e42ffd72889 100644 --- a/docs-v2/pages/connect/workflows.mdx +++ b/docs-v2/pages/connect/workflows.mdx @@ -239,29 +239,45 @@ We plan to improve this interface in the future, and potentially allow developer ## Testing workflow steps -To test a step that uses the connected account of one of your end users in the builder, you'll need a few things to be configured so that your workflow knows which account to use for the test. +To test a step using the connected account of one of your end users in the builder, you'll need a few things to be configured so that your workflow knows which account to use. -**Make sure you have an external user with the relevant connected accounts saved to your project:** +**Make sure you have an external user with the relevant connected account(s) saved to your project:** - Go to the **[Users tab](/connect#users)** in the **Connect** section of your project to confirm -- If not, you can [easily connect one in the UI](#connect-a-test-account) +- If not, either connect one from your application or [directly in the UI](#connect-a-test-account) **Pass the environment and external user ID:** 1. Once you've added an HTTP trigger to the workflow, click **Generate test event** +Generate test event 2. Click on the **Headers** tab 3. Make sure `x-pd-environment` is set (you'll likely want to `development`) 4. Make sure to also pass `x-pd-external-user-id` with the external user ID of the user you'd like to test with +Include required headers + ## Troubleshooting - For help debugging issues with your workflow, you can return verbose error messages to the caller by configuring the HTTP trigger to **Return a custom response from your workflow**. Configure custom response - +With that setting enabled on the trigger, below is an example of [this](/connect/workflows#required-account-not-found-for-external-user-id) error: -### Common errors +```bash +curl -X POST https://{your-endpoint-url} \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {access_token}' \ + -H "x-pd-environment: development" \ + -H "x-pd-external-user-id: abc-123" \ + -d '{ + "slackChannel": "#general", + "messageText": "Hello, world! (sent via curl)", + "hubSpotList": "prospects", + "contactEmail": "foo@example.com" + }' \ +Pipedream Connect Error: Required account for hubspot not found for external user ID abc-123 in development +``` +### Common errors #### No external user ID passed, but one or more steps require it - One or more steps in the workflow are configured to **Use end user's auth via Connect**, but no external user ID was passed when invoking the workflow. - [Refer to the docs](#invoke-the-workflow) to make sure you're passing external user ID correctly when invoking the workflow. From d2377f890e84fc7a8f5d5d6f788c4a9d63c638b4 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Dec 2024 17:07:21 -0800 Subject: [PATCH 4/5] Update pnpm-lock.yaml --- pnpm-lock.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e8b5c6b1cf95c..647509ff7ce6a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30645,8 +30645,6 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) - transitivePeerDependencies: - - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: From 6728af0d2ad572579736e56b92d6d11efad0065e Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Fri, 6 Dec 2024 17:08:51 -0800 Subject: [PATCH 5/5] pnpm-lock --- pnpm-lock.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 647509ff7ce6a..e8b5c6b1cf95c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30645,6 +30645,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: