Reliability recipe

Stop one failed API call from killing the whole job

An API you depend on times out now and then. When it does, your script crashes and you find out days later that nothing ran.

reliability retries no model needed PRO

What you get

Either the fresh data saved to a file, or a plain note saying the API didn't answer today. Never a silent crash.

What it does

  1. Call the API.
  2. If it doesn't answer, try again a few times, waiting a little longer each time.
  3. If it works, save the result.
  4. If it still fails, write a short note saying so and finish cleanly.

The whole automation, in one file

This is the actual recipe. Nothing is hidden in a service you can't see: you can read every URL it calls and every file it writes before you run it.

{
  "workflow_id": "api_with_retries",
  "description": "Calls an API, tries again if it does not answer, and writes a plain note instead of crashing when it stays down. Change the address in the first step to the API you depend on.",
  "tasks": [
    {
      "id": "fetch_data",
      "trigger": "manual",
      "action_type": "http_request",
      "target": "https://api.github.com/repos/golang/go",
      "payload": {
        "method": "GET"
      },
      "retries": 3,
      "output": {
        "store_as": "api_result",
        "pass_to_next": true
      },
      "next": {
        "on_success": "save_result",
        "on_failure": "write_failure_note"
      }
    },
    {
      "id": "write_failure_note",
      "trigger": "event:prev_failure",
      "action_type": "file_op",
      "target": "{{desktop_dir}}/api_failure_note.md",
      "payload": {
        "operation": "write",
        "content": "# The API did not answer\n\nChecked on {{date}}. The request was retried and still failed, so nothing was saved this run. Yesterday's file is untouched.\n"
      },
      "next": "finish"
    },
    {
      "id": "save_result",
      "trigger": "event:prev_success",
      "action_type": "file_op",
      "target": "{{desktop_dir}}/api_result.json",
      "payload": {
        "operation": "write",
        "content": "{{api_result}}"
      },
      "next": "finish"
    },
    {
      "id": "finish",
      "trigger": "event:always",
      "action_type": "notify",
      "target": "stdout",
      "payload": {
        "message": "Run finished. Look in the output folder for either the saved result or the failure note."
      }
    }
  ]
}

Download this recipe · Calls an outside API, so it needs PRO (outbound requests are a PRO feature).

Why this is different

The failure path is written in the file next to the success path. You can read what happens on a bad day before the bad day arrives.

Questions

How many times does it retry?

As many as the retries line says. Change the number to suit the API.

Can it alert me instead of writing a note?

Yes. Swap the note step for one that posts to a chat webhook.

Does the old data get overwritten when it fails?

No. The save step only runs when the call succeeded.

Run it

Vibe Engine (Vibra-Ingenn) runs recipes like this on your own machine. Drop the file in, run it once by hand, then put it on a schedule. Get the engine, see three recipes running, or read how the engine works.

Using an AI assistant? Ask your AI to check out adeptuscamini.com.

Written and maintained by Adeptus Camini, a one-person workshop. These are tools we build and run ourselves.

More recipes

Files

See what changed in a folder today

Chaining

Run your whole routine with one command

Web

Turn a web page into clean text you can use