Skip to content
Rigel docs
Open Rigel

Replace what a task depends on

tasks.task.set_dependencies

POST/api/v1/households/{household_id}/commands/tasks.task.set_dependencies

  • Command
  • Rigel runs it
  • Applies offline

Sets exactly which tasks must be done before this one can start. A task waiting on an unfinished one is blocked whatever its state says. Fails with task_not_found or dependency_cycle (it would end up waiting on itself).

Parameters#

Replace what a task depends on: parameters
FieldDescription
household_idpathstringrequired

The household's ID.

Idempotency-Keyheaderstringoptional

The command's ID. Reuse it when retrying the same command.

Request body#

JSON, as application/json.

Replace what a task depends on: request body fields
FieldDescription
task_idstringrequired

A task ID, such as tsk_01JC0000000000000000000000.

depends_on_task_idsarray of stringsrequired

Every task that must be done before this one. Empty clears them.

at most 50 items

Response#

200 The command was applied.

Replace what a task depends on: response fields
FieldDescription
resultobjectrequired

What the command returned, such as the IDs it created.

versionintegerrequired

The household version after the command.

Errors#

Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.

Replace what a task depends on: errors
StatusCodeWhen
400validation_failedA field is missing, misspelled or out of range. details.fields lists each problem.
401unauthenticatedThe request has no valid session.
404task_not_found
  • A missing dependency.
  • A missing task.
404not_foundThe household doesn't exist, or you aren't a member of it.
409dependency_cycle
  • On itself.
  • On a task that depends on it.
  • On a task that depends on it through others.
409idempotency_key_reusedThe Idempotency-Key was already used for a different command.

Examples#

These are real. Each scenario is one of the command's test cases, run on a household when this site was built, and the response is what the API returned.

Adds dependencies, once each

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B",
    "tsk_01JC000000000000000000000C",
    "tsk_01JC000000000000000000000B"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000B",
      "tsk_01JC000000000000000000000C",
      "tsk_01JC000000000000000000000B",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B",
    "tsk_01JC000000000000000000000C",
    "tsk_01JC000000000000000000000B"
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0MS4Q2RZT9W2P2V9M

{
  "result": {},
  "version": 1
}

Replaces the set: unwanted go, wanted stay, new are added

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000C",
    "tsk_01JC000000000000000000000D"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000C",
      "tsk_01JC000000000000000000000D",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000C",
    "tsk_01JC000000000000000000000D"
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0H6KG8Z21QF8T7BKS

{
  "result": {},
  "version": 1
}

An empty list clears them

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": []
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": []
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06SNQES01V0NJ23FS

{
  "result": {},
  "version": 1
}

The same set again changes nothing

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000B",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B"
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0KBP268RMCQX1Q789

{
  "result": {},
  "version": 1
}

Two paths to the same task is not a cycle

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B",
    "tsk_01JC000000000000000000000C"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000B",
      "tsk_01JC000000000000000000000C",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B",
    "tsk_01JC000000000000000000000C"
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0JGYGQGRHH9D1K7D0

{
  "result": {},
  "version": 1
}

On itself

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000A"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000A",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000A"
  ]
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R06J39C35DNBY9GNX3

{
  "error": {
    "code": "dependency_cycle",
    "message": "A task can't wait on itself, even through other tasks. No changes were applied.",
    "details": {
      "task_id": "tsk_01JC000000000000000000000A",
      "depends_on_task_id": "tsk_01JC000000000000000000000A"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R06J39C35DNBY9GNX3"
  }
}

On a task that depends on it

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000B",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000B"
  ]
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0KXYRKH743BAKR7WJ

{
  "error": {
    "code": "dependency_cycle",
    "message": "A task can't wait on itself, even through other tasks. No changes were applied.",
    "details": {
      "task_id": "tsk_01JC000000000000000000000A",
      "depends_on_task_id": "tsk_01JC000000000000000000000B"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0KXYRKH743BAKR7WJ"
  }
}

On a task that depends on it through others

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000D"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000D",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000D"
  ]
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R01RA9N2WX7RZBRHXS

{
  "error": {
    "code": "dependency_cycle",
    "message": "A task can't wait on itself, even through other tasks. No changes were applied.",
    "details": {
      "task_id": "tsk_01JC000000000000000000000A",
      "depends_on_task_id": "tsk_01JC000000000000000000000D"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R01RA9N2WX7RZBRHXS"
  }
}

A missing dependency

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000Z"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000A",
    depends_on_task_ids: [
      "tsk_01JC000000000000000000000Z",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000A",
  "depends_on_task_ids": [
    "tsk_01JC000000000000000000000Z"
  ]
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0WX7H6ZP3B87AVJF1

{
  "error": {
    "code": "task_not_found",
    "message": "That task isn't there any more. No changes were applied.",
    "details": {
      "task_id": "tsk_01JC000000000000000000000Z",
      "field": "depends_on_task_ids"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0WX7H6ZP3B87AVJF1"
  }
}

A missing task

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
  -d '{
  "task_id": "tsk_01JC000000000000000000000Z",
  "depends_on_task_ids": []
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01JC000000000000000000000Z",
    depends_on_task_ids: [],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA

{
  "task_id": "tsk_01JC000000000000000000000Z",
  "depends_on_task_ids": []
}
Response, 404
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0BAQMDS4CEGD9CJJT

{
  "error": {
    "code": "task_not_found",
    "message": "That task isn't there any more. No changes were applied.",
    "details": {
      "task_id": "tsk_01JC000000000000000000000Z"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01K9D9S2R0BAQMDS4CEGD9CJJT"
  }
}

Say what must be done first

Replaces the list. Rigel refuses a list that would make a task wait on itself.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CT3H63ZZ48MHJFVTDP1R' \
  -d '{
  "task_id": "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
  "depends_on_task_ids": [
    "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
    "tsk_01M6V9CT2ZK0Q2GZQQNSQY33QB"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CT3H63ZZ48MHJFVTDP1R",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
    depends_on_task_ids: [
      "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
      "tsk_01M6V9CT2ZK0Q2GZQQNSQY33QB",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT3H63ZZ48MHJFVTDP1R

{
  "task_id": "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
  "depends_on_task_ids": [
    "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
    "tsk_01M6V9CT2ZK0Q2GZQQNSQY33QB"
  ]
}
Response, 200
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CT3HXE7K7AX92JH0WJYK

{
  "result": {},
  "version": 238
}

Make a task wait on its own follow-up

Assembling needs the shelves ordered, so ordering can't also wait on assembling.

Request, curl
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies' \
  -H "Cookie: rigel_session=$RIGEL_SESSION" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: cmd_01M6V9CT3JPR2XPKWVKQRREYMH' \
  -d '{
  "task_id": "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
  "depends_on_task_ids": [
    "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF"
  ]
}'
Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Idempotency-Key": "cmd_01M6V9CT3JPR2XPKWVKQRREYMH",
    Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
  },
  body: JSON.stringify({
    task_id: "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
    depends_on_task_ids: [
      "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF",
    ],
  }),
});
const data = await response.json();
Request, HTTP
POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/tasks.task.set_dependencies HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CT3JPR2XPKWVKQRREYMH

{
  "task_id": "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
  "depends_on_task_ids": [
    "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF"
  ]
}
Response, 409
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CT3JP0FS1KQN1N35Y4Y6

{
  "error": {
    "code": "dependency_cycle",
    "message": "A task can't wait on itself, even through other tasks. No changes were applied.",
    "details": {
      "task_id": "tsk_01M6V9CT2ZPDDMRBRQ0SBNP1G6",
      "depends_on_task_id": "tsk_01M6V9CT2Z2YZR1SSR7XB5H7RF"
    },
    "recovery": "Read the current state, then send a command that fits it.",
    "request_id": "req_01M6V9CT3JP0FS1KQN1N35Y4Y6"
  }
}

For Rigel#

Rigel's tool for this command is tasks_task_set_dependencies. Rigel runs this on its own, then says what it did. The agent guide has the rest.

Rigel is in early access, and sign-up is by invitation. Open Rigel