How do I send a custom HTTP response from a workflow step?

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

Elton Morais : I need to create an endpoint that proccess the data received and show a custom response that I will build in a WorkFlow step. Could you point me to a documentation for that?

Nghia Nguyen : sounds like you want to send data to an HTTP endpoint and return a custom response? There’s an example workflow for that: Return a response from your workflow - Pipedream

Nghia Nguyen : you can also respond with HTML if you want, per Dylan’s example:

$respond({
  status: 200,
  headers: {
    "Content-Type": "text/html; charset=UTF-8"
  },
  body: `<html><h1>Hi, ${name}</html>`,
}) 

Elton Morais : Awesome. Thanks . I generated a CSV and responded with an file download. Worked like a charm.