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_contributorrole or higher in AgentRuntime.
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
- 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. - 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 exampleredis.example.com:6379redis_passwordredis_usernameredis_db, the database number
- 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.
- Smoke test
In Workflow Studio, add a connector step (type
mcp) withtool_nameredis_run_commandandtool_argsof{ "command": "PING", "args": [] }, then run it. The result isPONG. - Check reads and writes (optional)
Run
redis_setwith a test key andttl_secondsof 60, thenredis_getwith the same key.foundshould betrue.
See Integration authentication for how connections are bound to MCP instances.
What you can build
- Duplicate guard.
redis_existson a webhook event ID; if it is new,redis_setthe ID with a TTL and continue. - Usage limits.
redis_incron a per-customer key, then branch whenvaluepasses your threshold. - Cache. After a slow lookup,
redis_setthe result with a TTL. Later runs callredis_getfirst and use it whenfoundistrue. - Shared counters.
redis_incrandredis_decrtrack things like open items across many runs.
Tools
Tools marked Writes or Deletes change data in Redis.
| Tool | Description | Access |
|---|---|---|
redis_get | Get the string value at a key | Read |
redis_exists | Check whether a key exists | Read |
redis_ttl | Get a key's remaining time to live in seconds | Read |
redis_set | Store a string at a key, with an optional TTL | Writes |
redis_expire | Set a key's TTL in seconds | Writes |
redis_incr | Add 1 to an integer at a key | Writes |
redis_decr | Subtract 1 from an integer at a key | Writes |
redis_del | Delete one or more keys | Deletes |
redis_run_command | Run any Redis command with arguments | Writes (can do anything the user may) |
Arguments, with outputs:
| Tool | Arguments | Returns |
|---|---|---|
redis_get | key (required) | key, found, value (when found) |
redis_exists | key (required) | key, exists |
redis_ttl | key (required) | key, seconds |
redis_set | key, value (required), ttl_seconds (omit for no expiry) | key, ok |
redis_expire | key, seconds (required) | key, updated (true when the key exists) |
redis_incr, redis_decr | key (required) | key, value (the new number) |
redis_del | keys (required): a list of keys | deleted (how many were removed) |
redis_run_command | command (such as PING or HGETALL) and args (list of strings, may be empty), both required | command, 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.
| Key | Required | Default | Description |
|---|---|---|---|
redis_addr | No | 127.0.0.1:6379 | Server address as host:port |
redis_username | No | none | ACL username, if your server needs one |
redis_password | No | none | Password or ACL secret |
redis_db | No | 0 | Database number |
If you leave out redis_addr, the connector tries 127.0.0.1:6379, which is not your server. Always set it.
Troubleshooting
| Issue | Fix |
|---|---|
| Connection refused or timeout | Check 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 TLS | The connector has no TLS setting. Use an endpoint that accepts plain connections. |
NOAUTH or WRONGPASS | Set redis_password (and redis_username for ACL users) to match the server. |
redis_get returns found of false | The 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" error | The 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 left | Use redis_exists to check whether the key is there at all. |
Related
- Integrations quickstart
- Postgres connector: durable relational storage alongside Redis
- MySQL connector: another SQL backend
- Connector catalog
- Troubleshooting