AACFlow

Upstash

Serverless Redis с Upstash

Upstash — serverless data-платформа для современных приложений, которым нужно быстрое, простое и масштабируемое хранение данных с минимальной настройкой. Upstash специализируется на предоставлении Redis и Kafka как полностью управляемых облачных сервисов с оплатой за запрос, что делает его популярным выбором для разработчиков, создающих serverless-, edge- и event-driven архитектуры.

Upstash Redis позволяет:

  • Мгновенно сохранять и получать данные: читайте и записывайте key-value пары, хэши, списки, множества и многое другое через высокопроизводительный REST API.
  • Масштабироваться serverless-способом: никакой инфраструктуры. Upstash автоматически масштабируется вместе с приложением, и вы платите только за фактическое использование.
  • Получать глобальный доступ: разворачивайте сервис рядом с пользователями благодаря поддержке нескольких регионов и глобальной дистрибуции.
  • Легко интегрироваться: используйте REST API Upstash в serverless-функциях, edge-воркерах, Next.js, Vercel, Cloudflare Workers и других средах.
  • Автоматизировать через скрипты: запускайте Lua-скрипты для расширенных транзакций и автоматизации.
  • Обеспечивать безопасность: защищайте данные встроенной аутентификацией и TLS-шифрованием.

Интеграция Upstash в AACFlow даёт вашим агентам и воркфлоу возможность читать, записывать и управлять данными в Upstash Redis через простые унифицированные команды — это идеально подходит для масштабируемых автоматизаций, кэширования результатов, работы с очередями и многого другого без задач по администрированию серверов.

Инструкции по использованию

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

Инструменты

upstash_redis_get

Получить значение of a key from Upstash Redis.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to retrieve

Выходные данные

ПараметрТипОписание
keystringThe key that was retrieved
valuejsonThe value of the key (string), or null if not found

upstash_redis_set

Установить value of a key in Upstash Redis с an optional expiration time in seconds.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to set
valuestringДаThe value to store
exnumberНетExpiration time in seconds (optional)

Выходные данные

ПараметрТипОписание
keystringThe key that was set
resultstringThe result of the SET operation (typically "OK")

upstash_redis_delete

Удалить key from Upstash Redis.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to delete

Выходные данные

ПараметрТипОписание
keystringThe key that was deleted
deletedCountnumberNumber of keys deleted (0 if key did not exist, 1 if deleted)

upstash_redis_keys

Список keys matching a pattern in Upstash Redis. Defaults to listing all keys (*).

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
patternstringНетPattern to match keys (e.g., "user:"). Defaults to "" for all keys.

Выходные данные

ПараметрТипОписание
patternstringThe pattern used to match keys
keysarrayList of keys matching the pattern
countnumberNumber of keys found

upstash_redis_command

Выполнить an arbitrary Redis command against Upstash Redis. Pass the full command as a JSON array (e.g., [

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
commandstringДаRedis command as a JSON array (e.g., ["HSET", "myhash", "field1", "value1"]) or a simple command string (e.g., "PING")

Выходные данные

ПараметрТипОписание
commandstringThe command that was executed
resultjsonThe result of the Redis command

upstash_redis_hset

Set a field in a hash stored at a key in Upstash Redis.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe hash key
fieldstringДаThe field name within the hash
valuestringДаThe value to store in the hash field

Выходные данные

ПараметрТипОписание
keystringThe hash key
fieldstringThe field that was set
resultnumberNumber of new fields added (0 if field was updated, 1 if new)

upstash_redis_hget

Получить значение of a field in a hash stored at a key in Upstash Redis.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe hash key
fieldstringДаThe field name to retrieve

Выходные данные

ПараметрТипОписание
keystringThe hash key
fieldstringThe field that was retrieved
valuejsonThe value of the hash field (string), or null if not found

upstash_redis_hgetall

Получить все fields и values of a hash stored at a key in Upstash Redis.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe hash key

Выходные данные

ПараметрТипОписание
keystringThe hash key
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 — это set to 0 before incrementing.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to increment

Выходные данные

ПараметрТипОписание
keystringThe key that was incremented
valuenumberThe new value after incrementing

upstash_redis_expire

Set a timeout on a key in Upstash Redis. After the timeout, the key — это deleted.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to set expiration on
secondsnumberДаTimeout in seconds

Выходные данные

ПараметрТипОписание
keystringThe key that expiration was set on
resultnumber1 if the timeout was set, 0 if the key does not exist

upstash_redis_ttl

Получить 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.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to check TTL for

Выходные данные

ПараметрТипОписание
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.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe list key
valuestringДаThe value to prepend to the list

Выходные данные

ПараметрТипОписание
keystringThe list key
lengthnumberThe length of the list after the push

upstash_redis_lrange

Получить a range of elements from a list in Upstash Redis. Use 0 и -1 для start и stop to get all elements.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe list key
startnumberДаStart index (0-based, negative values count from end)
stopnumberДаStop index (inclusive, -1 for last element)

Выходные данные

ПараметрТипОписание
keystringThe list key
valuesarrayList of elements in the specified range
countnumberNumber of elements returned

upstash_redis_exists

Проверить if a key exists in Upstash Redis. Returns true if the key exists, false otherwise.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to check

Выходные данные

ПараметрТипОписание
keystringThe key that was checked
existsbooleanПроизошла ли key exists (true) or not (false)

upstash_redis_setnx

Установить value of a key only if it does not already exist. Returns true if the key was set, false if it already existed.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to set
valuestringДаThe value to store if the key does not exist

Выходные данные

ПараметрТипОписание
keystringThe key that was attempted to set
wasSetbooleanПроизошла ли 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 — это set to 0 before the operation.

Входные параметры

ПараметрТипОбязательныйОписание
restUrlstringДаUpstash Redis REST URL
restTokenstringДаUpstash Redis REST Token
keystringДаThe key to increment
incrementnumberДаAmount to increment by (use negative value to decrement)

Выходные данные

ПараметрТипОписание
keystringThe key that was incremented
valuenumberThe new value after incrementing

On this page

Начните создавать сегодня
Нам доверяют более 100 000 разработчиков.
SaaS-платформа для создания AI-агентов и управления агентным workforce.
Начать