New to Kestra?
Use blueprints to kickstart your first workflows.
Generate a mock user with name, email, and skills, then store it in Redis as a JSON key-value pair using Kestra's declarative orchestration.
id: redis-generate-mock-user-json
namespace: company.team
description: Set a single mock user JSON in Redis
tasks:
- id: datagen
type: io.kestra.plugin.datagen.core.Generate
generator:
type: io.kestra.plugin.datagen.generators.JsonObjectGenerator
locale: [ "en", "US" ]
value:
name: "#{name.fullName}"
email: "#{internet.emailAddress}"
skills: "#{job.keySkills}"
- id: set_redis
type: io.kestra.plugin.redis.json.Set
url: "{{ secret('REDIS_CLOUD') }}"
key: "{{ outputs.datagen.value['name'] }}"
value: |
{
"{{ outputs.datagen.value["email"] }}": "{{ outputs.datagen.value["skills"] }}"
}
Need realistic test data in Redis without writing a seed script? This blueprint generates a synthetic user record (name, email, and skills) with the data generation plugin and writes it straight into Redis as a JSON key-value pair. It is a fast way to seed a cache, populate a key namespace for local testing, or demo Redis-backed lookups, and you can run it repeatedly to fill the store with many keys.
datagen task (io.kestra.plugin.datagen.core.Generate) uses a JsonObjectGenerator with the en, US locale to produce one mock object containing a full name (#{name.fullName}), an email address (#{internet.emailAddress}), and a list of key job skills (#{job.keySkills}).set_redis task (io.kestra.plugin.redis.json.Set) connects to Redis using the connection string in {{ secret('REDIS_CLOUD') }}. It uses the generated name as the Redis key and writes a JSON value mapping the user's email to their skills, referencing the upstream outputs via {{ outputs.datagen.value[...] }}.Redis has no native scheduler or workflow engine, so seeding it on a cadence or as part of a larger pipeline usually means glue scripts and cron. With Kestra you declare the whole flow in YAML, chain the generation and write steps with clear output passing, and add event triggers, retries, and full execution lineage. You can fire this on a schedule, on a webhook, or as a subflow of a bigger data pipeline, and credentials stay in {{ secret() }} rather than living in code.
REDIS_CLOUD: the Redis connection string (URL) used to authenticate and connect.REDIS_CLOUD secret with your Redis connection string.datagen task output to see the generated record.GET on the generated name).JsonObjectGenerator value (phone, address, company) for richer records.ForEach to bulk-seed hundreds of keys in one run.Schedule trigger to refresh test data automatically, or chain a Redis Get task to validate the write.