API Input Node

When this node runs, it listens on an URL for user-submitted data.

In WebSocket subscription, you will see an event with type "event": "ApiInput":

{
  stream_id: 3,
  event: "ApiInput",
  data: {
    time: "2025-05-01T04:04:52.530223810Z",
    url: "http://localhost:8080/flow/submit/266ce6474131874412a2b9acd46497e58c2b04fcecd7a9738bad777ec9ebcd7f",
    flow_run_id: "fe853183-28b2-4f83-bd22-6cad8a2e2847"
  }
}

This event contains a URL to submit the data.

  • Send POST request to submit

    const body = { value: { S: "Hello" } };
    await fetch(event.data.url, {
        method: "POST",
        headers: [["content-type", "application/json"]],
        body: JSON.stringify(body),
    })

    In above example, node will output a string "Hello".

  • Send DELETE request to cancel

    await fetch(event.data.url, {
        method: "DELETE",
    })

    Node will return an error: "canceled by user".

You can set timeout via input, default is no timeout.

Last updated

Was this helpful?