On this page
Sommatic Docs
Open portal

Rate Limit

Throttles the number of executions allowed within a specific time window.

View as Markdown
Open in
Flow control Experimental flow.rate.limit Version 1.0.0 Execution: sync

Computes a throttling key and passes the payload through out with the limit as metadata; no limit is enforced, because the engine never reads it.

This operator enforces a rate limit policy (e.g., "10 requests per minute"). If the limit is exceeded, subsequent executions are routed to the 'throttled' port (or delayed, depending on engine configuration).

Behavior:

  • Key-based Throttling: Can throttle globally or per-key (e.g., per user ID).
  • Strategies: Fixed Window, Sliding Window (engine dependent).
  • Overflow: Excess requests trigger the 'throttled' port immediately.

Use Cases:

  • Protecting a fragile downstream API from overload.
  • Enforcing usage quotas for different user tiers.
  • Preventing spam or abuse.

How it works

  1. Resolves the config; limit defaults to 10 and window_seconds to 60.
  2. If the original key_expr text contains {{, the resolved value is used as the key (converted to a string). Otherwise key_expr is evaluated as JSONata against the payload (user_id); a falsy result or no key_expr gives global.
  3. A JSONata error is ignored and the key stays global.
  4. Returns the payload unchanged through out with meta.rate_limit { key, limit, window }. The engine ignores it: every execution passes.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-limit-exports",
  "label": "Limit exports",
  "operator_slug": "flow.rate.limit",
  "operator_version": "1.0.0",
  "config": {
    "limit": 10,
    "window_seconds": 60,
    "key_expr": "{{ $json.user_id }}"
  }
}

Configuration

limit integer Optional

Number of allowed executions in the window.

Default: 10

window_seconds integer Optional

Time duration for the rate limit window.

Default: 60

key_expr string Optional Accepts expressions

JSONata expression to derive the unique key. If empty, applies globally.

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

limit
Only echoed in meta.rate_limit; window_seconds is echoed as window.

Output ports

out default

Always.

Data
{
  "user_id": "u-42",
  "action": "export"
}
throttled

Never emitted: no counter is kept.

error

Never emitted.

In expressions

What a later node can read from this node's output with $("Rate Limit").item.json.<path> (write your node's label instead of Rate Limit). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.

ExpressionEditorWorker
$("Rate Limit").item.json.payloadobjectThe worker does not return it: reads as undefined —
$("Rate Limit").item.json.user_idstringNot suggested by the editor= "u-42"—
$("Rate Limit").item.json.actionstringNot suggested by the editor= "export"—

— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Input contract

payload object Optional

Output contract

payload object Optional

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "flow.rate.limit",
  "name": "Rate Limit",
  "category": "flow",
  "version": "1.0.0",
  "description": "Throttles the number of executions allowed within a specific time window.\n\n  This operator enforces a rate limit policy (e.g., \"10 requests per minute\"). If the limit is exceeded, subsequent executions are routed to the 'throttled' port (or delayed, depending on engine configuration).\n\n  **Behavior:**\n  - **Key-based Throttling:** Can throttle globally or per-key (e.g., per user ID).\n  - **Strategies:** Fixed Window, Sliding Window (engine dependent).\n  - **Overflow:** Excess requests trigger the 'throttled' port immediately.\n\n  **Use Cases:**\n  - Protecting a fragile downstream API from overload.\n  - Enforcing usage quotas for different user tiers.\n  - Preventing spam or abuse.",
  "capabilities": [
    "throttle",
    "limit",
    "control-flow"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "limit": {
        "type": "integer",
        "default": 10,
        "title": "Max Executions",
        "description": "Number of allowed executions in the window."
      },
      "window_seconds": {
        "type": "integer",
        "default": 60,
        "title": "Window (Seconds)",
        "description": "Time duration for the rate limit window."
      },
      "key_expr": {
        "type": "string",
        "title": "Throttling Key",
        "format": "expression",
        "description": "JSONata expression to derive the unique key. If empty, applies globally."
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    }
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "payload": {
        "type": "object"
      }
    }
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "payload": {
        "type": "object"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Passed",
      "is_default": true,
      "description": "Execution allowed (within limit)."
    },
    {
      "port_id": "throttled",
      "label": "Throttled",
      "description": "Execution blocked (limit exceeded)."
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Internal error."
    }
  ],
  "execution_mode": "sync",
  "tags": [
    "throttle",
    "limit",
    "quota"
  ],
  "is_stateful": true,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}

Execution

Execution
sync
Stateful
Yes
Retries (retryOnFail)
No
Capabilities
throttlelimitcontrol-flow
Tags
throttlelimitquota

Notes and limits

  • Not implemented: there is no shared counter, so throttled never fires. Rate-limit at the called service or space calls with your own logic.
  • meta is recorded in the run steps only: downstream nodes receive data as their payload and cannot read meta through $json or $("Node").

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs