How do I issue an HTTP response in Node.js?

How do I issue an HTTP response in a workflow with Node.js?

Hi @dylburger,

To issue an HTTP response in a workflow using Node.js, you can use the $.respond() function within an HTTP-triggered workflow. Here’s an example:

defineComponent({
  async run({ steps, $ }) {
    await $.respond({
      status: 200,
      headers: { "my-custom-header": "value" },
      body: { message: "My custom response" },
    });
  },
});

This function takes an object with properties specifying the body, headers, and HTTP status code you’d like to respond with. For more details, please refer to the HTTP responses documentation.
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double check my answers and code! Learn how to build your own.

Thanks @pi ! What about in Python?