Why does my Python request trigger "error in workflow" in custom code workflows despite generating successful and correct output in pipedream console logs?

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

Hi everyone, so I am stuck in a bit of a problem with custom code workflows. I have an HTTP trigger with a node.js code attached to it. I have set the response type to custom as well. When I send a request using my own python code to it, it always gives me “error in workflow”. However, for the SAME python request, the pipedream console logs show me the response was successful and correct output was generated. I am completely stumped as to why that is happening. Can someone please help me? I have even tried doing it with a very simple “hello world” type node.js code but it is still giving me “error in workflow” when I send the request from python.

When you set the trigger to return a custom response, you need to return an explicit response from your workflow. You can do this with the HTTP response step or in code Triggers - Pipedream

Tried that already…didn’t work. Not sure if it matters but I am on the free tier

can you share the code you’re using to return the HTTP response?

It should look something like this:

defineComponent({
  async run({ steps, $ }) {
    await $.respond({
      status: 200,
      headers: { "my-custom-header": "value" },
      body: { message: "My custom response" }, // This can be any string, object, Buffer, or Readable stream
    });
  },
});

this is exactly what it looks like

Could you please file a support ticket and share the link to your workflow?

Just submitted the support ticket. So this one is the simple test “hello world” type example I was talking about, not my real workflow. However, both have the same issue. If I can get this test workflow working, I’ll be able to modify my real one accordingly and get it working too.

Please let me know if you also want me to create another ticket for my real workflow

I believe there’s no problem, but if you want you can share the link to your real workflow so I can look at it specifically

I already responded the email

Thank you very much. Its working now. How can I increase my daily credit allowance?

The suggestion was to reduce memory in the workflow settings

But you can increase credits by subscribing to a paid plan

do you not have like a pay-as-you-go plan or where I can just buy the credits I want to use?