Autorun AI Docs
Process DesignerBusiness FunctionBusiness Functions Reference

13. HTTP Requests


SendHttpRequestAsync(values)

async · returns string

Sends an outbound HTTP request and returns the response body as a string.

Prop

Type

const response = await context.functions.SendHttpRequestAsync({
  url: "https://api.example.com/webhook",
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer my-token"
  },
  body: JSON.stringify({ event: "invoice_created", id: context.record.ID })
});

const data = JSON.parse(response);

Returned value — the full response body as a raw string. Parse it as JSON if needed:

{ "status": "received", "messageId": "msg_8f3a2b" }

GetEncodedString(text)

sync · returns string

Returns a Base64-encoded version of the input string. Commonly used to build HTTP Basic Auth headers.

Prop

Type

const encoded = context.functions.GetEncodedString("username:password");

const response = await context.functions.SendHttpRequestAsync({
  url: "https://api.example.com/data",
  method: "GET",
  headers: { "Authorization": "Basic " + encoded }
});

Returned value — the Base64-encoded string:

"dXNlcm5hbWU6cGFzc3dvcmQ="