Redis connector

Read, write, count, and expire Redis keys, or run any Redis command, from AgentRuntime workflows.

On this page

The redis connector connects your workflows to a Redis server you run or rent. It has simple helpers for string values, counters, and expiry, plus redis_run_command for anything else Redis can do.

Typical uses:

  • Skip duplicate work: remember a webhook event ID for an hour and ignore repeats.
  • Count events per customer to apply a limit.
  • Cache the result of a slow lookup so later runs can reuse it.

Prerequisites

  • A Redis server that AgentRuntime can reach over the network (self-hosted or from a managed provider).
  • Its address as host:port, and a password or ACL username and password if the server requires them.
  • A server endpoint that accepts plain, non-TLS connections. The connector has no TLS setting, so an endpoint that only accepts TLS will not work.
  • The database number, if you do not use database 0.
  • The project_contributor role or higher in AgentRuntime.
Warning

redis_run_command can run any Redis command, including ones that erase data. Use a Redis user with only the permissions your workflows need, and keep this connection away from production data you cannot afford to lose.

Connect in AgentRuntime

  1. Collect your Redis details

    From your Redis host or provider's dashboard, note the address (host:port), the password, and the username if your server uses ACL users.

  2. Create a connection

    In the Console, go to Connections and click New custom connection. Enter a display name, then use Add field under Credentials to add the keys below. Leave out any you do not need. Click Save.

    • redis_addr, for example redis.example.com:6379
    • redis_password
    • redis_username
    • redis_db, the database number
  3. Add the MCP instance

    Go to MCP, click Add connectors, click the redis connector and then Add to workspace, then open Instance config. Pick your connection, set the profile to active, and save.

  4. Smoke test

    In Workflow Studio, add a connector step (type mcp) with tool_name redis_run_command and tool_args of { "command": "PING", "args": [] }, then run it. The result is PONG.

  5. Check reads and writes (optional)

    Run redis_set with a test key and ttl_seconds of 60, then redis_get with the same key. found should be true.

See Integration authentication for how connections are bound to MCP instances.

What you can build

  • Duplicate guard. redis_exists on a webhook event ID; if it is new, redis_set the ID with a TTL and continue.
  • Usage limits. redis_incr on a per-customer key, then branch when value passes your threshold.
  • Cache. After a slow lookup, redis_set the result with a TTL. Later runs call redis_get first and use it when found is true.
  • Shared counters. redis_incr and redis_decr track things like open items across many runs.

Tools

Tools marked Writes or Deletes change data in Redis.

ToolDescriptionAccess
redis_getGet the string value at a keyRead
redis_existsCheck whether a key existsRead
redis_ttlGet a key's remaining time to live in secondsRead
redis_setStore a string at a key, with an optional TTLWrites
redis_expireSet a key's TTL in secondsWrites
redis_incrAdd 1 to an integer at a keyWrites
redis_decrSubtract 1 from an integer at a keyWrites
redis_delDelete one or more keysDeletes
redis_run_commandRun any Redis command with argumentsWrites (can do anything the user may)

Arguments, with outputs:

ToolArgumentsReturns
redis_getkey (required)key, found, value (when found)
redis_existskey (required)key, exists
redis_ttlkey (required)key, seconds
redis_setkey, value (required), ttl_seconds (omit for no expiry)key, ok
redis_expirekey, seconds (required)key, updated (true when the key exists)
redis_incr, redis_decrkey (required)key, value (the new number)
redis_delkeys (required): a list of keysdeleted (how many were removed)
redis_run_commandcommand (such as PING or HGETALL) and args (list of strings, may be empty), both requiredcommand, result

Example

Cache an API response for one hour:

{
  "id": "cache-result",
  "type": "mcp",
  "name": "Cache API response",
  "tool_name": "redis_set",
  "tool_args": {
    "key": "cache:weather:{{input.city}}",
    "value": "{{steps.fetch-weather.result.body}}",
    "ttl_seconds": 3600
  },
  "depends_on": ["fetch-weather"],
  "timeout_s": 10
}

value must be a string. In Workflow Studio you pick the MCP instance on the step.

Configuration

These are the keys the connector reads. All are optional, and a custom connection whose field names match them is wired automatically on Instance config.

KeyRequiredDefaultDescription
redis_addrNo127.0.0.1:6379Server address as host:port
redis_usernameNononeACL username, if your server needs one
redis_passwordNononePassword or ACL secret
redis_dbNo0Database number
Warning

If you leave out redis_addr, the connector tries 127.0.0.1:6379, which is not your server. Always set it.

Troubleshooting

IssueFix
Connection refused or timeoutCheck redis_addr, firewall rules, and that the server is reachable from the internet or your provider's allowed sources. Calls time out after 30 seconds.
Provider only accepts TLSThe connector has no TLS setting. Use an endpoint that accepts plain connections.
NOAUTH or WRONGPASSSet redis_password (and redis_username for ACL users) to match the server.
redis_get returns found of falseThe key does not exist or has expired. Check redis_db points at the database your app uses.
redis_incr fails with a "not an integer" errorThe key holds a non-numeric string. Delete the key or use a different one.
redis_ttl does not tell you why a key has no time leftUse redis_exists to check whether the key is there at all.
Edit this pageagentruntime-io/agentruntime-docs