Docs / Strand / connectors/redis
Redis Connector
Read, write, and publish data in Redis from your Strand workflows. Supports key-value operations, list operations, and pub/sub messaging.
Prerequisites
You need Redis server connection details to use this connector. You can connect to a hosted Redis service or an instance you run yourself.
Your Redis must be reachable from the internet. Strand runs in the cloud
and can only connect to publicly reachable addresses — not 10.x,
172.16–31.x,192.168.xor127.x.
See Connectors.
Hosted Redis (Redis Cloud, AWS ElastiCache, Upstash, etc.)
- Sign in to your Redis hosting provider's dashboard
- Locate your Redis instance and find the connection details:
- Host (e.g.,
redis-12345.c1.us-east-1-2.ec2.cloud.redislabs.com) - Port (usually
6379or a custom port) - Password (if authentication is enabled)
- Ensure SSL/TLS is enabled if required by your provider
Self-Hosted Redis
- Ensure your Redis server is accessible from Strand's infrastructure
- Note the hostname, port, and password (if configured via
requirepass)
Tip: Use a dedicated Redis user or password for your Strand workflows. Avoid sharing credentials with application services.
Required Permissions
If using Redis ACLs (Redis 6+), the user must have access to the following commands:
| Operation | Required ACL Commands |
|---|---|
| Set | SET |
| Get | GET |
| Delete | DEL |
| Publish | PUBLISH |
| LPUSH | LPUSH |
| RPUSH | RPUSH |
Tip: Configure via Redis ACL rules. Example:ACL SETUSER strand on >password ~app: +SET +GET +DEL +PUBLISH +LPUSH +RPUSH. Use key patterns (e.g.,~app:) to restrict access to specific key prefixes.
Connector Setup
Create a Redis connector from the Connectors page.
Configuration Fields
| Field | Required | Description |
|---|---|---|
| Name | Yes | Friendly name (e.g., "Production Redis") |
| Host | Yes | Redis server hostname or IP address |
| Port | No | Redis server port (default: 6379) |
| Password | No | Redis authentication password (encrypted at rest) |
| Database | No | Redis database index (default: 0, range: 0-15) |
| SSL | No | Enable SSL/TLS connection (default: false) |
| Timeout | No | Connection and operation timeout in seconds (default: 30) |
| Description | No | Optional description for reference |
Operations
Set
Set a key-value pair with an optional TTL (time-to-live).
| Field | Required | Description |
|---|---|---|
| Key | Yes | The Redis key (e.g., session:{{ payload.session_id }}) |
| Value | Yes | The value to store (string or JSON) |
| TTL (seconds) | No | Time-to-live in seconds. Key expires automatically after this duration. |
Example: Cache a user session:
- Key:
session:{{ payload.session_id }} - Value:
{
"user_id": "{{ payload.user_id }}",
"email": "{{ payload.email }}",
"role": "{{ payload.role }}"
}
- TTL:
3600
Get
Retrieve the value of a key.
| Field | Required | Description |
|---|---|---|
| Key | Yes | The Redis key to retrieve |
Example: Retrieve a cached session:
- Key:
session:{{ payload.session_id }}
Delete
Delete one or more keys.
| Field | Required | Description |
|---|---|---|
| Key | Yes | The Redis key to delete |
Example: Remove an expired session:
- Key:
session:{{ payload.session_id }}
Publish
Publish a message to a Redis pub/sub channel.
| Field | Required | Description |
|---|---|---|
| Channel | Yes | The pub/sub channel name (e.g., notifications) |
| Message | Yes | The message to publish (string or JSON) |
Example: Publish a notification event:
- Channel:
order-events - Message:
{
"event": "order_completed",
"order_id": "{{ payload.order_id }}",
"customer_id": "{{ payload.customer_id }}"
}
LPUSH
Prepend one or more values to the head of a list.
| Field | Required | Description |
|---|---|---|
| Key | Yes | The Redis list key |
| Values (JSON array) | Yes | JSON array of values to prepend |
Example: Add a job to a priority queue:
- Key:
queue:high-priority - Values:
["{{ payload.job_id }}"]
RPUSH
Append one or more values to the tail of a list.
| Field | Required | Description |
|---|---|---|
| Key | Yes | The Redis list key |
| Values (JSON array) | Yes | JSON array of values to append |
Example: Add an event to an activity log:
- Key:
activity:{{ payload.user_id }} - Values:
["{{ payload.event_type }}:{{ payload.timestamp }}"]
Output
Set Output
{
"success": true,
"status": "sent",
"data": {
"key": "session:abc123",
"result": "OK",
"ttl": 3600
},
"service": "redis",
"operation": "set"
}
Get Output
{
"success": true,
"status": "completed",
"data": {
"key": "session:abc123",
"value": "{\"user_id\":\"USR-001\",\"email\":\"[email protected]\",\"role\":\"admin\"}",
"exists": true
},
"service": "redis",
"operation": "get"
}
Key fields for subsequent nodes:
{{ steps.node_a1b2c3d4.output_payload.data.value }}: The stored value (as a string){{ steps.node_a1b2c3d4.output_payload.data.exists }}: Whether the key exists (trueorfalse)
Delete Output
{
"success": true,
"status": "completed",
"data": {
"key": "session:abc123",
"deleted_count": 1
},
"service": "redis",
"operation": "delete"
}
Publish Output
{
"success": true,
"status": "sent",
"data": {
"channel": "order-events",
"receivers": 3
},
"service": "redis",
"operation": "publish"
}
Key fields for subsequent nodes:
{{ steps.node_a1b2c3d4.output_payload.data.receivers }}: Number of subscribers that received the message
LPUSH Output
{
"success": true,
"status": "sent",
"data": {
"key": "queue:high-priority",
"list_length": 5
},
"service": "redis",
"operation": "lpush"
}
RPUSH Output
{
"success": true,
"status": "sent",
"data": {
"key": "activity:USR-001",
"list_length": 12
},
"service": "redis",
"operation": "rpush"
}
Errors
| Error | Meaning |
|---|---|
| Redis host is required | Host not configured in connector. |
| Key is required | No key specified for the operation. |
| Value is required | No value provided for a Set operation. |
| Channel is required | No channel specified for a Publish operation. |
| Message is required | No message provided for a Publish operation. |
| Values array is required | No values provided for LPUSH or RPUSH. |
| NOAUTH Authentication required | The Redis server requires a password but none was provided. |
| ERR invalid password | The provided password is incorrect. |
| WRONGTYPE Operation against a key holding the wrong kind of value | Attempted a list operation on a string key, or vice versa. |
| Connection refused | Could not connect to the Redis server. Check host, port, and network access. |
| Connection timed out | The connection to Redis timed out. Check network connectivity and server status. |
Example Workflow
- Create Connector with your Redis host, port, and password
- Get the current state of a resource:
- Key:
order:{{ payload.order_id }}
- Set updated state after processing:
- Key:
order:{{ payload.order_id }} - Value:
{"status": "{{ payload.new_status }}", "updated_at": "{{ payload.timestamp }}"} - TTL:
86400
- Publish a notification to subscribers:
- Channel:
order-updates - Message:
{"order_id": "{{ payload.order_id }}", "status": "{{ payload.new_status }}"}
Limitations
- Subscribe: Redis SUBSCRIBE (long-lived listener) is not supported. Use Publish for outbound messaging. For inbound events, use a webhook or HTTP trigger.
- Transactions: Redis MULTI/EXEC transactions are not currently supported.
- Lua scripting: EVAL and EVALSHA commands are not supported.
- Key patterns: KEYS and SCAN commands for listing keys are not currently supported.
- Data types: Hash, Set, and Sorted Set operations (HSET, SADD, ZADD, etc.) are not currently supported.
- Value size: Redis values are limited to 512 MB, but large values may impact workflow performance. Keep values under 1 MB for optimal results.
- Cluster mode: Redis Cluster with multiple shards is not currently supported. Use a single-node or sentinel-based setup.
Tendrl