# Redis

Run a Redis command.

## Connect Redis

1. In the sidebar, open **Connections** and press **Add connection**.
2. Type `redis` and choose **Redis**.
3. Fill in the fields. Each one says **Required** or **Optional**.
4. Press **Test and save**. GoRunner checks the connection before it saves anything.

The sheet asks for **Server**, **Port**, **Password**, **Database number** and **Connection address**.

[Connections](https://docs.gorunner.io/build/connections) says how to sign in again, rename or delete it. In a product that embeds GoRunner, **Add connection** can be missing: then [your provider makes connections](https://docs.gorunner.io/embed/customer-connections) for you.

## Do things in Redis

Add a **Redis** step and choose an **Operation**. Choose the row to see the fields of each.

- [Command](https://docs.gorunner.io/apps/redis#fields-f-command): GET · SET · DEL · EXISTS · INCR · DECR · EXPIRE · TTL · KEYS · LPUSH · RPUSH · LPOP · RPOP · LRANGE · LLEN · SADD · SMEMBERS · HSET · HGET · HGETALL · PUBLISH · INFO

To start a workflow from Redis, use a [Schedule](https://docs.gorunner.io/apps/schedule), [Webhook](https://docs.gorunner.io/apps/webhook) or [Form](https://docs.gorunner.io/apps/form) trigger.

Later steps read a step’s output by its name: see [Use data from earlier steps](https://docs.gorunner.io/build/use-data-from-earlier-steps).

## Limits

- GoRunner Cloud reaches servers on the public internet only. On a self-hosted installation, an admin can allow private addresses with `WORKFLOW_PRIVATE_NETWORKS`.

Not in your list? See [When an app isn’t here](https://docs.gorunner.io/apps/when-an-app-isnt-here#q-not-in-list).

## For developers

In the API, which calls apps pieces, Redis is `pieceId: "redis"` with `actionId: "command"`, set by `operation`. [Get an app](https://docs.gorunner.io/api/apps/get-app) returns every field.

It can change something outside the run (`writes_external`). See [How versions and side effects work](https://docs.gorunner.io/apps#q-versions).

### Redis › Command

Run a Redis command (string/counter/list/set/hash/pub-sub).

### GET, DEL, EXISTS, INCR, DECR, TTL, LPOP, RPOP, LLEN, SMEMBERS and HGETALL

- **Key · Optional**: The name this value is stored under, such as user:123:email.

### SET

- **Key · Optional**: The name this value is stored under, such as user:123:email.
- **Value · Optional**: The text to store, add to the list/set, or save under the hash field.
- **TTL (seconds) · Optional**: Expiry in seconds (0 = no expiry).

### EXPIRE

- **Key · Optional**: The name this value is stored under, such as user:123:email.
- **TTL (seconds) · Optional**: Expiry in seconds (0 = no expiry).

### KEYS

- **Pattern · Optional**: Key glob pattern, such as user:*. Default: *.
- **Get Values · Optional**: Also fetch each matching key's value, returning a key→value object. Turn off to return just the list of key names. On by default.

### LPUSH, RPUSH and SADD

- **Key · Optional**: The name this value is stored under, such as user:123:email.
- **Value · Optional**: The text to store, add to the list/set, or save under the hash field.

### LRANGE

- **Key · Optional**: The name this value is stored under, such as user:123:email.
- **Start Index · Optional**: Position of the first list item to return, counting from 0, such as 0 for the first item. Default: 0.
- **Stop Index · Optional**: -1 for the end of the list. Default: -1.

### HSET and HGET

- **Key · Optional**: The name this value is stored under, such as user:123:email.
- **Field · Optional**: Hash field name.

### PUBLISH

- **Channel · Optional**: Name of the channel to send the message to, such as notifications.
- **Message · Optional**: The text to broadcast to everyone listening on the channel.

### INFO

Nothing to fill in.

Source: https://docs.gorunner.io/apps/redis
