Blueprints

Store and retrieve JSON data using Redis

Source

yaml
id: redis-key-value-store
namespace: company.team

inputs:
  - id: key
    type: STRING
    defaults: johndoe
  - id: value
    type: JSON
    defaults: |
      {
        "id": 123456,
        "name": "John Doe",
        "email": "[email protected]",
        "age": 30,
        "address": {
          "street": "123 Main Street",
          "city": "Anytown",
          "state": "California",
          "country": "United States"
        },
        "phone": "+1 555-123-4567",
        "isPremium": true,
        "interests": ["programming", "reading", "traveling"]
      }

tasks:
  - id: set
    type: io.kestra.plugin.redis.string.Set
    url: redis://host.docker.internal:6379/0
    serdeType: JSON
    key: "{{ inputs.key }}"
    value: "{{ inputs.value }}"

  - id: get
    type: io.kestra.plugin.redis.string.Get
    url: redis://host.docker.internal:6379/0
    serdeType: JSON
    key: "{{ inputs.key }}"

About this blueprint

Ingest

This flow will set a key-value pair in Redis and then retrieve it. The key-value pair will be set using inputs which can be provided at runtime. To test this flow, you can start Redis in a Docker container: docker run --name myredis -p 6379:6379 -d redis

Set

Get

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra