Graine AI
API referenceWorkflows

List sample workflows

Ready-made workflows to start from: call and try again, qualify leads, payment and renewal reminders, appointment and order confirmation, feedback, a CRM deal follow-up.

Ready-made workflows to start from: call and try again, qualify leads, payment and renewal reminders, appointment and order confirmation, feedback, a CRM deal follow-up. Create one with POST /v2/workflows and {"sample": "<id>", "agent_id": "<your agent>"}.

Rate limit: 2000 requests per minute per organization, counted together with every endpoint that has no stricter limit of its own. Exceeding it returns 429 with Retry-After; the X-RateLimit-* response headers report your remaining allowance on every call.

GET
/v2/workflow-samples
/v2/workflow-samples?page=1&page_size=20

The Authorization access token

Authorization

Authorization
Required
Bearer <token>

Your Graine API key. Create one in the dashboard under Developers, or via POST /v2/api-keys. Send it as Authorization: Bearer <key>.

In: header

Query Parameters

pagePage

1-indexed page number (max 10000 — narrow the window instead)

Default: 1Minimum: 1Maximum: 10000

page_sizePage Size

Items per page (max 100)

Default: 20Minimum: 1Maximum: 100

Response Body

200

The samples.

data
Required
Data

pagination
Required
Pagination

Where the returned page sits in the whole result set.

Emitted verbatim on every list endpoint. The same three fields appear on every page of every collection, so a client can page through any of them with one loop.

401

1100 — missing, unknown or inactive API key. 1101 — a browser session token was presented instead of an API key.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

403

1102 — the key is valid but lacks the scope this endpoint requires, or names another organization. GET /v2/scopes reports what a key holds.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

422

Validation Error

error
Required
integer

Stable integer code from the error table. Branch on this, not on the message.

message
Required
string

One human-readable sentence. Wording may change; the code will not.

429

1300 — the per-organization request rate or concurrent-call limit was reached. Carries Retry-After.

error
Required
Error

Stable integer code from the /v2 error table. Branch on this.

message
Required
Message

One human-readable sentence. Wording may change; the code will not.

curl -X GET "https://api.graine.ai/v2/workflow-samples?page=1&page_size=20" \
  -H "Authorization: Bearer <token>"

The samples.

{
  "data": [
    {
      "id": "lead_qualification",
      "name": "Qualify new leads",
      "summary": "Call a new lead while the enquiry is fresh, send hot leads to your CRM, and call warm ones again two days later.",
      "reads": [],
      "definition": {
        "entry_node_id": "start",
        "on_no_match": "unreached",
        "nodes": [
          {
            "id": "start",
            "type": "start",
            "config": {
              "fields": [
                {
                  "name": "plan",
                  "type": "string"
                }
              ]
            },
            "cases": [
              {
                "when": {
                  "always": true
                },
                "then": {
                  "to": "call"
                }
              }
            ]
          },
          {
            "id": "call",
            "type": "agent",
            "config": {
              "agent_id": "agt_0123",
              "timeout_s": 1800
            },
            "cases": [
              {
                "when": {
                  "cmp": "==",
                  "left": {
                    "var": "call.status"
                  },
                  "right": {
                    "const": "completed"
                  }
                },
                "then": {
                  "to": "done"
                }
              }
            ]
          },
          {
            "id": "done",
            "type": "end",
            "config": {
              "label": "reached",
              "outcome": "success"
            }
          },
          {
            "id": "unreached",
            "type": "end",
            "config": {
              "label": "unreached",
              "outcome": "failure"
            }
          }
        ]
      }
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 20,
    "total": 137,
    "total_pages": 7,
    "has_more": true
  }
}