{
  "schema_version": 2,
  "id": "commands/exec",
  "title": "EXEC",
  "url": "https://redis.io/docs/latest/commands/exec/",
  "summary": "Executes all commands in a transaction.",
  "since": "1.2.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:21+01:00",
  "page_type": "content",
  "content_hash": "a48660a05517403d7826f37010ae39abc1acd3498b97b27c3178efbe328b9137",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "> [!NOTE]\n> This command's behavior varies in clustered Redis environments. See the [multi-key operations](https://redis.io/docs/latest/develop/using-commands/multi-key-operations) page for more information.\n\n\nExecutes all previously queued commands in a [transaction](https://redis.io/docs/latest/develop/using-commands/transactions) and restores the\nconnection state to normal.\n\nWhen using [`WATCH`](https://redis.io/docs/latest/commands/watch), `EXEC` will execute commands only if the watched keys were\nnot modified, allowing for a [check-and-set mechanism](https://redis.io/docs/latest/develop/using-commands/transactions#cas)."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Array reply](../../develop/reference/protocol-spec#arrays): each element being the reply to each of the commands in the atomic transaction.\n* [Nil reply](../../develop/reference/protocol-spec#bulk-strings): the transaction was aborted because a `WATCH`ed key was touched.\n\n**RESP3:**\n\nOne of the following:\n* [Array reply](../../develop/reference/protocol-spec#arrays): each element being the reply to each of the commands in the atomic transaction.\n* [Null reply](../../develop/reference/protocol-spec#nulls): the transaction was aborted because a `WATCH`ed key was touched."
    }
  ],
  "examples": []
}
