AACFlow

Upstash

Serverless Redis with Upstash

Usage Instructions

Connect to Upstash Redis to perform key-value, hash, list, and utility operations via the REST API.

Tools

upstash_redis_get

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description

Output

ParameterTypeDescription
keystringThe key that was retrieved
valuejsonThe value of the key (string), or null if not found

upstash_redis_set

Set the value of a key in Upstash Redis with an optional expiration time in seconds.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
valuestringYesNo description
exnumberNoNo description

Output

ParameterTypeDescription
keystringThe key that was set
resultstringThe result of the SET operation (typically "OK")

upstash_redis_delete

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description

Output

ParameterTypeDescription
keystringThe key that was deleted
deletedCountnumberNumber of keys deleted (0 if key did not exist, 1 if deleted)

upstash_redis_keys

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
patternstringNoPattern to match keys (e.g., "user:"). Defaults to "" for all keys.

Output

ParameterTypeDescription
patternstringThe pattern used to match keys
keysarrayList of keys matching the pattern
countnumberNumber of keys found

upstash_redis_command

Execute an arbitrary Redis command against Upstash Redis. Pass the full command as a JSON array (e.g., [

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
commandstringYesRedis command as a JSON array (e.g., ["HSET", "myhash", "field1", "value1"]) or a simple command string (e.g., "PING")

Output

ParameterTypeDescription
commandstringThe command that was executed
resultjsonThe result of the Redis command

upstash_redis_hset

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
fieldstringYesNo description
valuestringYesNo description

Output

ParameterTypeDescription
keystringkey output from the tool
fieldstringThe field that was set
resultnumberNumber of new fields added (0 if field was updated, 1 if new)

upstash_redis_hget

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
fieldstringYesNo description

Output

ParameterTypeDescription
keystringkey output from the tool
fieldstringThe field that was retrieved
valuejsonThe value of the hash field (string), or null if not found

upstash_redis_hgetall

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description

Output

ParameterTypeDescription
keystringkey output from the tool
fieldsobjectAll field-value pairs in the hash, keyed by field name
fieldCountnumberNumber of fields in the hash

upstash_redis_incr

Atomically increment the integer value of a key by one in Upstash Redis. If the key does not exist, it is set to 0 before incrementing.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description

Output

ParameterTypeDescription
keystringThe key that was incremented
valuenumberThe new value after incrementing

upstash_redis_expire

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
secondsnumberYesNo description

Output

ParameterTypeDescription
keystringThe key that expiration was set on
resultnumber1 if the timeout was set, 0 if the key does not exist

upstash_redis_ttl

Get the remaining time to live of a key in Upstash Redis. Returns -1 if the key has no expiration, -2 if the key does not exist.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description

Output

ParameterTypeDescription
keystringThe key checked
ttlnumberRemaining TTL in seconds. Positive integer if the key has a TTL set, -1 if the key exists with no expiration, -2 if the key does not exist.

upstash_redis_lpush

Prepend a value to the beginning of a list in Upstash Redis. Creates the list if it does not exist.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
valuestringYesNo description

Output

ParameterTypeDescription
keystringkey output from the tool
lengthnumberThe length of the list after the push

upstash_redis_lrange

Get a range of elements from a list in Upstash Redis. Use 0 and -1 for start and stop to get all elements.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
startnumberYesNo description
stopnumberYesNo description

Output

ParameterTypeDescription
keystringkey output from the tool
valuesarrayList of elements in the specified range
countnumberNumber of elements returned

upstash_redis_exists

Check if a key exists in Upstash Redis. Returns true if the key exists, false otherwise.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description

Output

ParameterTypeDescription
keystringThe key that was checked
existsbooleanWhether the key exists (true) or not (false)

upstash_redis_setnx

Set the value of a key only if it does not already exist. Returns true if the key was set, false if it already existed.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
valuestringYesNo description

Output

ParameterTypeDescription
keystringThe key that was attempted to set
wasSetbooleanWhether the key was set (true) or already existed (false)

upstash_redis_incrby

Increment the integer value of a key by a given amount. Use a negative value to decrement. If the key does not exist, it is set to 0 before the operation.

Input

ParameterTypeRequiredDescription
restUrlstringYesNo description
restTokenstringYesNo description
keystringYesNo description
incrementnumberYesNo description

Output

ParameterTypeDescription
keystringThe key that was incremented
valuenumberThe new value after incrementing

On this page

Start building today
Trusted by over 100,000 builders.
The SaaS platform to build AI agents and run your agentic workforce.
Get started