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.x or 127.x.
See Connectors.

Hosted Redis (Redis Cloud, AWS ElastiCache, Upstash, etc.)

  1. Sign in to your Redis hosting provider's dashboard
  2. Locate your Redis instance and find the connection details:
  1. Ensure SSL/TLS is enabled if required by your provider

Self-Hosted Redis

  1. Ensure your Redis server is accessible from Strand's infrastructure
  2. 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:

json

{
  "user_id": "{{ payload.user_id }}",
  "email": "{{ payload.email }}",
  "role": "{{ payload.role }}"
}

Get

Retrieve the value of a key.

Field Required Description
Key Yes The Redis key to retrieve

Example: Retrieve a cached session:

Delete

Delete one or more keys.

Field Required Description
Key Yes The Redis key to delete

Example: Remove an expired session:

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:

json

{
  "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:

json

["{{ 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:

json

["{{ payload.event_type }}:{{ payload.timestamp }}"]

Output

Set Output

json

{
  "success": true,
  "status": "sent",
  "data": {
    "key": "session:abc123",
    "result": "OK",
    "ttl": 3600
  },
  "service": "redis",
  "operation": "set"
}

Get Output

json

{
  "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:

Delete Output

json

{
  "success": true,
  "status": "completed",
  "data": {
    "key": "session:abc123",
    "deleted_count": 1
  },
  "service": "redis",
  "operation": "delete"
}

Publish Output

json

{
  "success": true,
  "status": "sent",
  "data": {
    "channel": "order-events",
    "receivers": 3
  },
  "service": "redis",
  "operation": "publish"
}

Key fields for subsequent nodes:

LPUSH Output

json

{
  "success": true,
  "status": "sent",
  "data": {
    "key": "queue:high-priority",
    "list_length": 5
  },
  "service": "redis",
  "operation": "lpush"
}

RPUSH Output

json

{
  "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

  1. Create Connector with your Redis host, port, and password
  2. Get the current state of a resource:
  1. Set updated state after processing:
  1. Publish a notification to subscribers:

Limitations