step

redis

Execute Redis in-memory database operations.

Overview

Supports operations:
- get: Get value by key
- set: Set key-value pair
- delete: Delete key
- exists: Check if key exists
- expire: Set key expiration
- incr/decr: Increment/decrement numeric value
- hset/hget/hdel: Hash operations

Setup:
1. Set up a Redis instance (local installation, cloud provider, or managed service like Redis Cloud)
2. Note your connection details: host, port, database number
3. If authentication is enabled, get your password
4. Store connection details securely (e.g., environment variables or connection string)

Connection: Requires host and port. Password optional depending on setup.

Examples

Set key-value pair

Store a value in Redis with optional TTL

type: redis
connection_string: ${env:REDIS_URL}
operation: set
key: user:1234:session
value: '{"session_id": "abc123", "logged_in": true}'
ttl: 3600
output_to: redis_result

Get value by key

Retrieve a value from Redis

type: redis
host: localhost
port: 6379
db: 0
operation: get
key: user:1234:session
output_to: session_data

Increment counter

Atomically increment a numeric value

type: redis
connection_string: ${env:REDIS_URL}
operation: incr
key: page:views:homepage
output_to: view_count

Set hash field

Store a field in a Redis hash

type: redis
connection_string: ${env:REDIS_URL}
operation: hset
key: user:1234
field: last_login
value: 2024-01-15T10:30:00Z
output_to: hash_result

Delete key

Remove a key from Redis

type: redis
connection_string: ${env:REDIS_URL}
operation: delete
key: temp:data:xyz
output_to: delete_result

Configuration

Parameter Type Required Description
type string No Step type identifier
Default: "redis"
connection_string string No Redis connection string in format redis://[password@]host:port/db (takes precedence over individual host/port/db fields)
host string No Redis server hostname or IP address (alternative to connection_string)
port integer No Redis server port number
Default: 6379
db integer No Redis database number (0-15 in default configuration)
Default: 0
password string No Redis password for authentication (if required)
operation string Yes Redis operation: get (retrieve value), set (store value), delete (remove key), exists (check key), expire (set TTL), incr/decr (increment/decrement), hset/hget/hdel (hash operations)
Options: get, set, delete, exists, expire, incr, decr, hset, hget, hdel
key string Yes Redis key to operate on (supports template substitution)
value string No Value to store (required for set and hset operations, can be string, number, or JSON-serializable object)
field string No Hash field name (required for hset, hget, and hdel operations)
ttl string No Time-to-live in seconds for the key (optional for set operation, sets expiration)
amount integer No Amount to increment or decrement (for incr and decr operations)
Default: 1
timeout integer No Connection timeout in seconds
Default: 30
output_to string No Key name where the operation result will be stored in the event
Default: "redis"

Base Configuration

These configuration options are available on all steps:

Parameter Type Default Description
name null Optional name for this step (for documentation and debugging)
description null Optional description of what this step does
retries integer 0 Number of retry attempts (0-10)
backoff_seconds number 0 Backoff (seconds) applied between retry attempts
retry_propagate boolean false If True, raise last exception after exhausting retries; otherwise swallow.