New to Kestra?
Use blueprints to kickstart your first workflows.
Push and pop string values on a Redis list with Kestra. Clear stale entries, then repopulate the list idempotently using declarative YAML tasks.
id: redis-list
namespace: company.team
variables:
key: favorite_plugins
tasks:
- id: clear_list
type: io.kestra.plugin.redis.list.ListPop
url: redis://host.docker.internal:6379/0
key: "{{ vars.key }}"
maxRecords: 1
- id: publish_list
type: io.kestra.plugin.redis.list.ListPush
url: redis://host.docker.internal:6379/0
key: "{{ vars.key }}"
from:
- redis
- duckdb
- gcp
- aws
This blueprint shows how to manage a Redis list from a Kestra workflow by clearing it and then repopulating it with a known set of string values. It solves a common problem with append style writes: because ListPush always appends, re-running a flow against an existing list produces duplicate entries. By popping the list first and pushing afterward, you get an idempotent, repeatable result every time the flow runs. It is a clean pattern for seeding queues, refreshing reference lists, and managing ordered collections in Redis without hand written client code.
clear_list task (io.kestra.plugin.redis.list.ListPop) removes existing entries from the list stored at the key variable (favorite_plugins), using maxRecords: 1 to pop from the head of the list.publish_list task (io.kestra.plugin.redis.list.ListPush) appends a fresh set of string values (redis, duckdb, gcp, aws) to the same key with its from property.url property (redis://host.docker.internal:6379/0), and the list key is parameterized through the flow level vars.key variable so it is easy to change in one place.ListPop and ListPush tasks together.Redis itself has no scheduler or workflow engine: it stores data but does not decide when or in what order list operations run. Kestra fills that gap. You can attach event triggers or schedules, enforce ordering so the pop always precedes the push, add retries for transient connection failures, and capture execution lineage and logs for every run. The declarative YAML keeps the whole pipeline in version control instead of scattered scripts.
url.This flow uses no secrets. It connects with a plain url and is intended for local testing. For production, move the connection string to a secret such as {{ secret('REDIS_URL') }}.
docker run --name myredis -p 6379:6379 -d redis.vars.key value to target a different list.from values with outputs from an upstream task.maxRecords to drain longer lists before repopulating.