Why am I Receiving an HTTP Error 400 When Using Pipedream Connect to Authenticate Users and Trigger a Workflow in my Next.js App?

This topic was automatically generated from Slack. You can find the original thread here.

Hello! I am using Pipedream Connect to authenticate users and then trigger a workflow using the pd.invokeWorkflowForExternalUser method, but I keep getting this error: “Error: HTTP error! status: 400, body: Error in workflow”. I am running the method on the backend of a next app. The method is essentially the same as the example given, except I am replacing a few values with variables, passed from the frontend. The pipedream workflow is triggering and running correctly. My hope is to be able to return the response from the pipedream workflow and use that data in our app. Any suggestions would be appreciated - been stuck on this for the better part of the day. Thank you!

This could be an issue of the workflow memory, yeah ?

What’s the memory config at ?

Yea, or some other error — can you open the workflow in the Pipedream UI? Does it give you any additional details in the event inspector?

The memory is at the minimum 256mb. The workflow itself is flowing smoothly with no timeouts and is returning the expected data (its the channel list of the dummy slack account previously authenticated on my app.

Hm, would you mind enabling the parent project to Share with Support, then pasting the workflow URL here? I’d like to take a quick look.

Just for reference, the flow of our Sparrow next app is:

  1. have user select a Sparrow accounts
  2. run the PDC oauth workflow to authenticate slack, using the Sparrow account id as the external user id
  3. On success, trigger a pipedream workflow that returns slack channels using the just-authenticated external user id.
  4. have user be able to interact with the return channel data

do I need to merge the workflow into production for support to see it?

No

Here is the trigger url - https://eons7yopehlv50.m.pipedream.net

And here is the page url - Sign Up - Pipedream

Thanks Danny!

I see that the return_http_response step isn’t merged to production, right? I have a feeling that might be the issue, since your trigger is configured to return a custom response from the workflow.

Can you try merging that to production then triggering it again?

Sure! Standby

Great that worked! Thank you!

Nice, no problem. Better debug info would’ve been nice there, but glad you’re unstuck!

What sort of debug info off the bat would have helpful? I’ll make sure to include it next time

Oh no sorry, I mean from Pipedream. Instead of just a 400 getting returned to you, a more verbose error would’ve been nice so that you could debug.

Oh sure! But thats what you guys are for! Thanks again, I’m sure I’ll be back soon. My boss loves PD so we’re really digging in.