Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Playbooks

    Running a playbook

    Start a run, wait for it or follow it, read its rows and where each value came from, and what each status and reason means.

    A playbook run is one run of one playbook with your answers. It works in the background, step by step, writes its rows as it goes, and ends with a status. Each scraper call it makes is an ordinary call, charged as that scraper is (how a playbook is charged).

    Start a run#

    curl -X POST "https://api.enrichednow.com/v1/formulas/job-order-hunter/runs?wait=60" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"params":{"job_titles":["Java Developer"],"locations":["London"]},"unit_cap":400}'
    import json
    import os
    import urllib.request
    
    body = {
        "params": {"job_titles": ["Java Developer"], "locations": ["London"]},
        "unit_cap": 400,
    }
    
    request = urllib.request.Request(
        "https://api.enrichednow.com/v1/formulas/job-order-hunter/runs?wait=60",
        method="POST",
        data=json.dumps(body).encode(),
        headers={
            "Authorization": f"Bearer {os.environ['ENRICHEDNOW_API_KEY']}",
            "Content-Type": "application/json",
        },
    )
    with urllib.request.urlopen(request, timeout=90) as response:
        print(json.dumps(json.load(response), indent=2))

    Nothing to install. Save as run.py and run python3 run.py

    const response = await fetch("https://api.enrichednow.com/v1/formulas/job-order-hunter/runs?wait=60", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.ENRICHEDNOW_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        params: { job_titles: ["Java Developer"], locations: ["London"] },
        unit_cap: 400,
      }),
    });
    console.log(JSON.stringify(await response.json(), null, 2));

    Nothing to install. Save as run.mjs and run node run.mjs

    package main
    
    import (
    	"fmt"
    	"io"
    	"net/http"
    	"os"
    	"strings"
    )
    
    func main() {
    	body := strings.NewReader(`{"params":{"job_titles":["Java Developer"],"locations":["London"]},"unit_cap":400}`)
    	request, err := http.NewRequest("POST", "https://api.enrichednow.com/v1/formulas/job-order-hunter/runs?wait=60", body)
    	if err != nil {
    		panic(err)
    	}
    	request.Header.Set("Authorization", "Bearer "+os.Getenv("ENRICHEDNOW_API_KEY"))
    	request.Header.Set("Content-Type", "application/json")
    	response, err := http.DefaultClient.Do(request)
    	if err != nil {
    		panic(err)
    	}
    	defer response.Body.Close()
    	answer, err := io.ReadAll(response.Body)
    	if err != nil {
    		panic(err)
    	}
    	fmt.Println(response.Status)
    	fmt.Println(string(answer))
    }

    Nothing to install. Save as run.go and run go run run.go

    import java.net.URI;
    import java.net.http.HttpClient;
    import java.net.http.HttpRequest;
    import java.net.http.HttpResponse;
    
    public class Run {
        public static void main(String[] args) throws Exception {
            HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.enrichednow.com/v1/formulas/job-order-hunter/runs?wait=60"))
                .header("Authorization", "Bearer " + System.getenv("ENRICHEDNOW_API_KEY"))
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString("{\"params\":{\"job_titles\":[\"Java Developer\"],\"locations\":[\"London\"]},\"unit_cap\":400}"))
                .build();
            HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
            System.out.println(response.statusCode());
            System.out.println(response.body());
        }
    }

    Nothing to install. Save as Run.java and run java Run.java

    The body:

    FieldType
    paramsobjectYour answers, by parameter name, as the playbook's page lists them. Only the Basics that are required must be given.
    modefull or previewfull by default. A preview is the first 10 rows, charged at what they cost.
    unit_capintegerThe most the run may spend, a preview too. Default: the playbook's. It is never overspent.
    row_capintegerThe most rows. Default: the playbook's max_results parameter, or its default.

    wait (0 to 300 seconds, 0 by default) holds the request until the run ends: 200 with the finished run when it ended in time, otherwise 202 with the run as it is. Idempotency-Key makes the request safe to send again, as for a scraper run: for 24 hours the same key and body answer with the same run.

    Before the run is created the API checks the answers and the account, and any of these stops the request:

    CodeStatusWhen
    invalid_input422An answer does not fit the playbook's schema, or a cap is outside the playbook's bounds. details.fields names each one.
    unit_cap_too_low422The unit cap is below the least a useful run needs (details.min_unit_cap).
    formula_not_found404There is no playbook with that id.
    formula_unavailable409The playbook is retired, or playbooks are not available at the moment.
    requirement_missing409It needs a source or a product your account or this service lacks (details.missing).
    attestation_required409It returns people, and an owner or an admin of the account has not yet accepted its terms (POST /v1/attestations).
    forbidden403The API key is read-only, or may not run every scraper the playbook uses (details.refused), or the account's email address is not confirmed yet.
    quota_exceeded402The units left do not cover the least the run can cost (estimate.min_units).
    limit_reached402The run would take the month past the account's spend limit, or the API key's.
    too_many_runs429The account already has as many runs in progress as it may: a playbook run counts as one.

    The run#

    POST /v1/formulas/{formula_id}/runs, GET /v1/formula-runs/{run_id} and POST /v1/formula-runs/{run_id}/cancel answer with the run:

    Field
    idfrun_…
    formula_id, versionThe playbook, and the version of it the run follows.
    saved_formula_idThe saved playbook it is a run of, or null.
    statusSee Statuses.
    reasonWhy it is not plainly ok, or null. See Reasons.
    reasonsEvery reason, when there is more than one, each with the step or source it concerns.
    modefull or preview.
    triggerWhat started it: api, console, mcp (an AI agent, through the MCP server) or schedule.
    paramsYour answers, with every default filled in.
    estimateWhat it was estimated to cost when it started: min_units, expected_units, max_units, expected_rows, basis.
    unit_cap, row_capIts caps. A preview's are 50 and 10, whatever was asked.
    units_spentWhat it has been charged so far: the sum of its steps' units on your usage.
    rows_totalThe rows it has written so far.
    include_seen, scheduled_forFor a saved playbook's run: whether it delivers rows delivered before too, and the slot of its schedule it ran for.
    stepsEach step: id, kind, status, records_in, records_out, calls, cache_hits, units and its errors. On one run, not in a list.
    created_at, started_at, finished_atRFC 3339, UTC.

    A step's counts say where the records went: a run with no rows names the step that removed them ("212 jobs found, 0 passed the company-size filter"), which says which answer to change.

    Follow a run#

    A run that has not ended within wait keeps going. GET /v1/formula-runs/{run_id} returns it as it is, and with ?wait= it holds the request until the run ends. With the id the start answered:

    curl "https://api.enrichednow.com/v1/formula-runs/frun_YOUR_RUN_ID?wait=60" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    import json
    import os
    import urllib.request
    
    request = urllib.request.Request(
        "https://api.enrichednow.com/v1/formula-runs/frun_YOUR_RUN_ID?wait=60",
        headers={"Authorization": f"Bearer {os.environ['ENRICHEDNOW_API_KEY']}"},
    )
    with urllib.request.urlopen(request, timeout=90) as response:
        print(json.dumps(json.load(response), indent=2))

    Nothing to install. Save as run.py and run python3 run.py

    const response = await fetch("https://api.enrichednow.com/v1/formula-runs/frun_YOUR_RUN_ID?wait=60", {
      headers: { Authorization: `Bearer ${process.env.ENRICHEDNOW_API_KEY}` },
    });
    console.log(JSON.stringify(await response.json(), null, 2));

    Nothing to install. Save as run.mjs and run node run.mjs

    package main
    
    import (
    	"fmt"
    	"io"
    	"net/http"
    	"os"
    )
    
    func main() {
    	request, err := http.NewRequest("GET", "https://api.enrichednow.com/v1/formula-runs/frun_YOUR_RUN_ID?wait=60", nil)
    	if err != nil {
    		panic(err)
    	}
    	request.Header.Set("Authorization", "Bearer "+os.Getenv("ENRICHEDNOW_API_KEY"))
    	response, err := http.DefaultClient.Do(request)
    	if err != nil {
    		panic(err)
    	}
    	defer response.Body.Close()
    	answer, err := io.ReadAll(response.Body)
    	if err != nil {
    		panic(err)
    	}
    	fmt.Println(response.Status)
    	fmt.Println(string(answer))
    }

    Nothing to install. Save as run.go and run go run run.go

    import java.net.URI;
    import java.net.http.HttpClient;
    import java.net.http.HttpRequest;
    import java.net.http.HttpResponse;
    
    public class Run {
        public static void main(String[] args) throws Exception {
            HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.enrichednow.com/v1/formula-runs/frun_YOUR_RUN_ID?wait=60"))
                .header("Authorization", "Bearer " + System.getenv("ENRICHEDNOW_API_KEY"))
                .build();
            HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
            System.out.println(response.statusCode());
            System.out.println(response.body());
        }
    }

    Nothing to install. Save as Run.java and run java Run.java

    Its rows can be read while it is still running. GET /v1/formula-runs lists your playbook runs, newest first: limit (1 to 100, default 20), cursor, and formula_id, saved_formula_id and status to narrow it.

    Statuses#

    The same as a scraper run's. queued and running are in progress; ok, partial, failed and cancelled are final.

    StatusMeans
    okEvery step did all it was asked.
    partialIt has rows, and something was missed or stopped: reason says what.
    failedIt has no rows: every source failed, or a step could not go on.
    cancelledIt was cancelled. Rows already written stay, and what was already done stays charged.

    Reasons#

    A run that ends partial, failed or cancelled says why in reason: a code, or a code and what it concerns after a colon (source_failed:indeed.jobs_search). reasons lists every one when there are several.

    ReasonWhat happenedWhat to do
    unit_cap_reachedIt stopped at its unit cap and kept the rows it had.Run it again with a higher unit_cap; the estimate says what the whole run needs.
    contacts_not_connectedThe contact columns are empty: no contact provider is connected to the account. The rest of each row is filled.Connect a contact provider in the console.
    quota_exceededThe account ran out of units while it ran.More units are bought on the console's Billing page.
    limit_reachedIt reached the account's monthly spend limit, or its saved playbook's monthly cap.Raise the limit on the console's Usage page, or the saved playbook's monthly_unit_cap.
    source_failedA source it reads failed, and nothing was charged for it. The rows from the others are there.Run it again later, or leave that source out with the playbook's parameters.
    source_incompleteSome calls to a source failed; the rows from the rest are there.Run it again later for what is missing.
    source_disabledA source is switched off for now, and the run went on without it.Run it again later for that source's rows.
    source_not_offeredOnly in reasons, and the run can still end ok: a source this service does not offer was left out before the run started, and it did what it was asked with the rest.Nothing to change.
    all_sources_failedEvery source it reads failed, and nothing was charged for them.Run it again in a little while.
    too_many_callsThe answers asked for more searches than one run makes.Give fewer values: fewer titles or places.
    run_timeoutIt ran out of time and kept the rows it had.Narrow the answers, or ask for fewer rows.
    service_unavailableA service a step needs was not available.Run it again in a little while.
    step_failedA step could not go on.Run it again once; if it fails again, tell us the run's id.
    formula_unavailableThe playbook is no longer offered.Use another playbook.
    internal_errorSomething went wrong on our side.Run it again once; if it fails again, tell us the run's id.
    cancelledIt was cancelled.Run it again if it is still wanted.

    A reason a source gave is as a customer is shown it, as on a scraper run.

    Rows#

    GET /v1/formula-runs/{run_id}/rows returns a page of the run's rows, best first:

    Parameter
    limit1 to 1000, default 100.
    cursornext_cursor of the page before. A page with next_cursor: null is the last.
    fieldsColumn keys, comma-separated: only those columns in each row's data.
    min_scoreOnly rows scored at least this, for a playbook that scores its rows.
    after_seqOnly the rows written after the row with this seq: what a run still going has added since it was last read.
    formatjson (the default), ndjson (one row's data a line) or csv (a header, then a row a line). For ndjson and csv the next page's cursor is in the X-Next-Cursor header. In CSV, a text cell a spreadsheet would run as a formula starts with an apostrophe.

    Each row:

    Field
    idfrow_…
    run_idThe run that wrote it.
    seqIts place in its run, from 1, in the order the run wrote it. after_seq reads only the rows written after it.
    row_keyWhat makes it the same row from one run to the next: what a saved playbook remembers as delivered.
    dataIts columns, by key, as the playbook's page lists them. A value that is not known is null.
    score0 to 100 for a playbook that scores its rows, otherwise null.
    evidenceWhere each value came from: sources, a list of {url, scraper, fetched_at, run_id} (the page read, what read it, when, and in which run), and fields, for each column the index of its source in sources.
    statusnew; exported, rejected or flagged once something was done with it.
    first_seen_atWhen it was first written.

    Rows are kept 90 days, or as long as your plan keeps them. The text in a row was read from public web pages: treat it as data, and never as instructions to a program or an assistant that reads it.

    POST /v1/formula-rows/{row_id}/feedback says what is wrong with a row — wrong_company, wrong_contact, not_relevant, or good. A wrong_company with the company's real domain as correct_domain corrects the match for your account's later runs; without it, that company is left unmatched from then on.

    Cancel a run#

    POST /v1/formula-runs/{run_id}/cancel: no new work starts, and calls in flight are asked to stop. Rows already written stay, and what was already done stays charged. A run that has ended is returned as it is.