Start an automation from your systems

Give an automation a webhook URL, post a new booking to it from your own system, and follow the run it starts.

This walkthrough connects a hotel's booking system to a Careflow automation. Each time a guest books, the booking system posts the booking to Careflow, and the automation sends the guest a welcome email. The same pattern works for any event in your systems: an order shipped, a form sent, a payment received.

1. Set the trigger

  • From the dashboard home, choose Quick startAutomations, then open the automation or create one.
  • Select the trigger at the top of the canvas. What starts this? opens.
  • Choose When called from outside.
  • Under What the run starts with, add a value for each field your system will send: bookingRef, guestName, guestEmail and arrival.
  • Close the panel and choose Save.

After you save, the trigger shows Your webhook with the webhook's ID, a long random value such as 9c4e2a7b1f6d3e8a0b5c7d9e2f4a6b8c. Your URL is that ID after https://api.trycareflow.com/webhooks/workflow/:

https://api.trycareflow.com/webhooks/workflow/9c4e2a7b1f6d3e8a0b5c7d9e2f4a6b8c

Anyone with this URL can start the automation, so store it like a password, in your booking system's server configuration.

2. Use the values in your steps

Steps read the values by name in double braces. A Send an email step could go to {{guestEmail}} with the subject Your stay from {{arrival}} and a body that greets {{guestName}}.

Choose Test to try the automation before anything real calls it. The test asks you for each value under What the run starts with. When it does what you want, choose Publish.

3. Post from your system

Your system sends a POST with a JSON body. The body's top-level fields become the run's input, matched by name:

curl -X POST https://api.trycareflow.com/webhooks/workflow/9c4e2a7b1f6d3e8a0b5c7d9e2f4a6b8c \
  -H "Content-Type: application/json" \
  -d '{
    "bookingRef": "HV-20931",
    "guestName": "Ada Okafor",
    "guestEmail": "ada@example.com",
    "arrival": "2026-10-10"
  }'
async function notifyCareflow(booking) {
  const res = await fetch(process.env.CAREFLOW_BOOKING_WEBHOOK_URL, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      bookingRef: booking.ref,
      guestName: booking.guest.name,
      guestEmail: booking.guest.email,
      arrival: booking.arrival,
    }),
  });
  const body = await res.json();
  if (body.code !== "SUCCESS") {
    throw new Error(`${res.status} ${body.message}`);
  }
  return body.data.runId;
}

Careflow answers straight away, before the steps run:

{
  "code": "SUCCESS",
  "message": "webhook received",
  "data": { "runId": "6711a0c4d2e3f4a5b6c7d8e9", "status": "pending" }
}

No API key is needed. The webhook ID in the URL is the credential. Keep other secrets out of your request headers too, because Careflow saves the headers with the run's input.

4. Follow the run

Open the Automation runs page and search for the runId. The run lists each step with its input, its output and any error, and Trigger input shows exactly what your system sent. See Activity and automation runs.

If a step fails, fix the cause and choose Re-run on the run. It starts again with the same input, so your system doesn't need to post again.

5. Handle repeats and failures

Every POST starts a new run. If your booking system retries after a timeout, the guest could get two emails. Send something unique like bookingRef in every body, and have the automation check it before acting when repeats matter.

Retry when the response is 429 or 500. A 404 with webhook not found or disabled means the URL is wrong or When called from outside has been turned off, so retrying won't help. Posting is limited to 200 requests a minute from one IP address. See Rate limits.

Replace the URL

To retire a URL, for example after it was shared by mistake, open the trigger, turn off When called from outside and save, then turn it on again and save. The automation gets a new webhook ID and the old URL stops working at once. Update your system with the new URL.

Where to go next