HashiCorp Nomad
App · 17 actions
Run, dispatch, scale and stop Nomad jobs, see their status, allocations and logs, restart allocations, drain nodes and keep Nomad Variables up to date. Start a workflow when a job, allocation or deployment fails, or a node goes down.
Actions
| Action | What it does |
|---|---|
| Delete variable | Delete a Nomad Variable and all its keys. |
| Dispatch job | Start a run of a parameterized job, such as a report or a backup, with a payload and meta values for it to use. |
| Drain node | Drain a node before maintenance, such as a reboot: Nomad moves its allocations to other nodes and places nothing new on it. |
| Get job status | See how a job is doing: its status and version, each task group's running and failed allocations, and its latest deployment. |
| Get task logs | Read the last lines a task printed, its output or its errors, such as to send with an alert when it fails. |
| Get variable | Read a Nomad Variable's keys and values, such as an app's settings, to use in a later step. |
| List job allocations | List a job's allocations (the copies of it Nomad placed on nodes), newest first, with the node each is on, its status and how each task is doing, or only those with a status, such as failed. |
| List jobs | List the jobs in the connection's namespace with their status and how many allocations are running or failed, such as for a status report, or only those with a status or type. |
| List nodes | List the nodes (client machines) with their status, whether they are draining or take new work, and their working drivers, or only those with a status, such as down. |
| Put variable | Set keys of a Nomad Variable, such as a new database address for jobs to read, creating it if it isn't there. |
| Restart allocation | Restart a running allocation's tasks where they are, such as to pick up a changed setting, or only one task. |
| Run job | Submit a job file to Nomad, like nomad job run: a new job starts, and a changed one is updated (rolling out as its update block says). |
| Run periodic job now | Start a run of a periodic job now rather than at its next scheduled time, such as a backup before a change. |
| Scale task group | Change how many copies of a job's task group Nomad runs, such as more web servers for a sale, or 0 to pause it. |
| Set node eligibility | Stop Nomad placing new allocations on a node, leaving what runs there alone, or let it place them again. |
| Stop allocation | Stop one allocation, such as a stuck one; Nomad places a new one for its job, on the same node or another. |
| Stop job | Stop a job: Nomad stops all its allocations. |
Delete variable
Delete a Nomad Variable and all its keys. Nomad keeps no history, so it can't be brought back.
Inputs
- Path
pathtextRequired - The variable's path, as Nomad's Variables page shows it, such as apps/web/config.
- Only if unchanged since
cas_indexnumber - A modify index from 'Get variable': it is deleted only if nothing changed it since. Leave blank to delete it anyway.At least 1.
Outputs
deletedtrue/false- False when there was no variable there
keyslist- The keys it had
pathtext- The variable's path
Example output
{
"deleted": true,
"keys": [
"db_host"
],
"path": "apps/old/config"
}Dispatch job
Start a run of a parameterized job, such as a report or a backup, with a payload and meta values for it to use.
Inputs
- Job
job_idtextRequired - The parameterized job's ID, as Nomad's Jobs page shows it, such as web.
- Payload
payloadtext - Text for the job to read, such as JSON; Nomad writes it to the file the job's dispatch_payload names. Up to 16 KB.
- Meta
metaobject - Names and values the job reads as NOMAD_META_<name>, such as customer and acme. Only names the job's parameterized block allows.
Outputs
dispatched_job_idtext- The run it started, such as report/dispatch-1794347625-f85613cb
eval_idtext- The ID of the evaluation Nomad made to act on it
job_idtext- The parameterized job
linktext- A link to the run in Nomad
metaobject- The meta sent with it
Example output
{
"dispatched_job_id": "report/dispatch-1794347625-f85613cb",
"eval_id": "65081436-ede0-f4e9-37f8-2583e4f9a277",
"job_id": "report",
"link": "https://nomad.example.com:4646/ui/jobs/report%2Fdispatch-1794347625-f85613cb@default",
"meta": {
"customer": "acme"
}
}Drain node
Drain a node before maintenance, such as a reboot: Nomad moves its allocations to other nodes and places nothing new on it. Or stop a drain.
Inputs
- Node
nodetextRequired - The node (client machine), by its name or ID, such as worker-1.
- Drain
enabletrue/false - On to drain the node, off to stop draining it.Default:
true. - Deadline (minutes)
deadline_minutesnumber - How long allocations get to move before Nomad stops what's left. 0 waits as long as it takes. Leave blank for 60.Only when Drain is
true. At least 0. - Leave system jobs running
ignore_system_jobstrue/false - Keep system jobs (such as log shippers) on the node.Only when Drain is
true. Default:false. - Reason
reasontext - Why, shown in Nomad, such as Kernel update.Only when Drain is
true. - Take new work again
mark_eligibletrue/false - Let Nomad place new allocations on the node again.Only when Drain is
false. Default:true.
Outputs
addresstext- Its address
datacentertext- Its datacenter
drain_deadline_minutesnumber- How long the drain may take, in minutes; 0 when it was turned off or has no deadline
drain_statustext- How its last drain went: draining, complete or canceled; empty if never drained
drainingtrue/false- True while it is being drained
driverslist- The task drivers working on it, such as docker
eligibilitytext- eligible or ineligible
eligibletrue/false- True when Nomad may place new work on it
idtext- The node's ID
linktext- A link to the node in Nomad
nametext- The node's name
node_classtext- Its node class, if it has one
node_pooltext- Its node pool
short_idtext- The first 8 characters of its ID, as Nomad shows it
statustext- initializing, ready, down or disconnected
status_descriptiontext- Why it has that status, when Nomad says
versiontext- The Nomad version it runs
Example output
{
"address": "10.0.0.21",
"datacenter": "dc1",
"drain_deadline_minutes": 60,
"drain_status": "draining",
"draining": true,
"drivers": [
"docker",
"raw_exec"
],
"eligibility": "ineligible",
"eligible": false,
"id": "52aa801d-ad79-af47-6667-2dfe52faf893",
"link": "https://nomad.example.com:4646/ui/clients/52aa801d-ad79-af47-6667-2dfe52faf893",
"name": "worker-1",
"node_class": "",
"node_pool": "default",
"short_id": "52aa801d",
"status": "ready",
"status_description": "",
"version": "2.1.1"
}Get job status
See how a job is doing: its status and version, each task group's running and failed allocations, and its latest deployment.
Inputs
- Job
job_idtextRequired - The job's ID, as Nomad's Jobs page shows it, such as web.
Outputs
allocationsobject- How many of its allocations are queued, starting, running, complete, failed, lost and unknown
childrenobject- For a periodic or parameterized job, how many of its runs are pending, running and dead
datacenterslist- The datacenters it may run in
idtext- The job's ID
latest_deploymentobject- Its latest deployment: id, status (running, successful, failed, cancelled), description and job_version; empty for a job without one
linktext- A link to the job in Nomad
metaobject- The job's meta keys and values
nametext- The job's name
namespacetext- The namespace, such as default
parameterizedtrue/false- True for a job that runs when dispatched
parent_idtext- For one run of a periodic or parameterized job, its job
periodictrue/false- True for a job that runs on a schedule
prioritynumber- The job's priority, 1 to 100
regiontext- The region, such as global
stabletrue/false- True when this version deployed successfully
statustext- pending, running or dead
status_descriptiontext- Why it has that status, when Nomad says
stoppedtrue/false- True when someone stopped the job
submitted_attext- When this version was submitted, ISO 8601 UTC
task_groupslist- Its task groups
typetext- service, batch, system or sysbatch
versionnumber- The job's version, counting from 0; each change adds one
Example output
{
"allocations": {
"complete": 2,
"failed": 0,
"lost": 0,
"queued": 0,
"running": 3,
"starting": 0,
"unknown": 0
},
"children": {
"dead": 0,
"pending": 0,
"running": 0
},
"datacenters": [
"dc1"
],
"id": "web",
"latest_deployment": {
"description": "Deployment completed successfully",
"id": "3f9ebb80-c3c6-91fc-6974-1dff666e1127",
"job_version": 4,
"status": "successful"
},
"link": "https://nomad.example.com:4646/ui/jobs/web@default",
"meta": {
"team": "payments"
},
"name": "web",
"namespace": "default",
"parameterized": false,
"parent_id": "",
"periodic": false,
"priority": 50,
"region": "global",
"stable": true,
"status": "running",
"status_description": "",
"stopped": false,
"submitted_at": "2026-11-02T09:14:03Z",
"task_groups": [
{
"complete": 2,
"count": 3,
"failed": 0,
"lost": 0,
"name": "web",
"queued": 0,
"running": 3,
"tasks": [
"server"
]
}
],
"type": "service",
"version": 4
}Get task logs
Read the last lines a task printed, its output or its errors, such as to send with an alert when it fails.
Inputs
- Allocation
allocation_idtextRequired - The allocation, by its ID or the 8 characters Nomad shows, such as 8d2f1c3a. 'List job allocations' gives it.
- Task
tasktext - The task. Leave blank when the allocation runs only one.
- Which log
streamtext - Its output or its errors.One of:
stdout(Standard output),stderr(Errors (stderr)). Default:stdout. - Lines
linesnumber - How many of the last lines, up to 1000. Leave blank for 50.From 1 to 1000.
Outputs
allocation_idtext- The allocation's ID
line_countnumber- How many lines
lineslist- The last lines, oldest first
linktext- A link to the task's logs in Nomad
more_beforetrue/false- True when the log has earlier lines than these
streamtext- stdout or stderr
tasktext- The task
texttext- The lines as one text
Example output
{
"allocation_id": "8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01",
"line_count": 2,
"lines": [
"connecting to db.internal:5432",
"error: connection refused"
],
"link": "https://nomad.example.com:4646/ui/allocations/8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01/server/logs",
"more_before": false,
"stream": "stderr",
"task": "server",
"text": "connecting to db.internal:5432\nerror: connection refused"
}Get variable
Read a Nomad Variable's keys and values, such as an app's settings, to use in a later step. One that isn't there comes back with found false rather than failing the step. The values are in the step's result, so anyone who can see this workflow's runs can see them.
Inputs
- Path
pathtextRequired - The variable's path, as Nomad's Variables page shows it, such as apps/web/config.
Outputs
foundtrue/false- False when there is no variable at that path
itemsobject- Its keys and values
keyslist- Its keys
linktext- A link to the variable in Nomad
modified_attext- When it last changed, ISO 8601 UTC
modify_indexnumber- Its modify index; give it to 'Only if unchanged since' to write only if nothing changed it since
namespacetext- The namespace, such as default
pathtext- The variable's path, such as apps/web/config
Example output
{
"found": true,
"items": {
"db_host": "10.0.0.5",
"feature_x": "on"
},
"keys": [
"db_host",
"feature_x"
],
"link": "https://nomad.example.com:4646/ui/variables/var/apps/web/config@default",
"modified_at": "2026-11-02T09:14:03Z",
"modify_index": 220,
"namespace": "default",
"path": "apps/web/config"
}List job allocations
List a job's allocations (the copies of it Nomad placed on nodes), newest first, with the node each is on, its status and how each task is doing, or only those with a status, such as failed.
Inputs
- Job
job_idtextRequired - The job's ID, as Nomad's Jobs page shows it, such as web.
- Status
statustext - Only allocations with this status.One of:
any(Any status),running,pending,complete,failed,lost. Default:any.
Outputs
allocationslist- Its allocations, newest first
by_statusobject- How many listed are in each status
countnumber- How many are listed
job_idtext- The job's ID
linktext- A link to the job's allocations in Nomad
Example output
{
"allocations": [
{
"client_status": "running",
"created_at": "2026-11-02T09:14:03Z",
"description": "Tasks are running",
"desired_status": "run",
"failed_tasks": [],
"id": "8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01",
"job_id": "web",
"job_version": 4,
"link": "https://nomad.example.com:4646/ui/allocations/8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01",
"modified_at": "2026-11-02T09:14:09Z",
"name": "web.web[0]",
"namespace": "default",
"node_id": "52aa801d-ad79-af47-6667-2dfe52faf893",
"node_name": "worker-1",
"short_id": "8d2f1c3a",
"task_group": "web",
"tasks": [
{
"exit_code": null,
"failed": false,
"finished_at": "",
"last_event": "Task started by client",
"name": "server",
"restarts": 0,
"started_at": "2026-11-02T09:14:09Z",
"state": "running"
}
]
}
],
"by_status": {
"running": 1
},
"count": 1,
"job_id": "web",
"link": "https://nomad.example.com:4646/ui/jobs/web@default/allocations"
}List jobs
List the jobs in the connection's namespace with their status and how many allocations are running or failed, such as for a status report, or only those with a status or type.
Inputs
- Status
statustext - Only jobs with this status.One of:
any(Any status),running,pending,dead(Dead (finished, stopped or failed)). Default:any. - Type
job_typetext - Only jobs of this type.One of:
any(Any type),service,batch,system,sysbatch(System batch). Default:any. - ID starts with
prefixtext - Only jobs whose ID starts with this, such as web-.
- Include runs of periodic and parameterized jobs
include_runstrue/false - Also list each run a periodic or parameterized job started, such as nightly-backup/periodic-1794347625.Default:
false.
Outputs
by_statusobject- How many jobs listed are pending, running and dead
countnumber- How many jobs are listed
jobslist- The jobs, by ID
namespacetext- The namespace, such as default
truncatedtrue/false- True when there were more than 1000 and the rest were left out
Example output
{
"by_status": {
"running": 2
},
"count": 2,
"jobs": [
{
"allocations": {
"complete": 0,
"failed": 0,
"lost": 0,
"queued": 0,
"running": 3,
"starting": 0,
"unknown": 0
},
"children": {
"dead": 0,
"pending": 0,
"running": 0
},
"datacenters": [
"dc1"
],
"id": "web",
"link": "https://nomad.example.com:4646/ui/jobs/web@default",
"name": "web",
"namespace": "default",
"parameterized": false,
"parent_id": "",
"periodic": false,
"priority": 50,
"status": "running",
"stopped": false,
"submitted_at": "2026-11-02T09:14:03Z",
"type": "service"
},
{
"allocations": {
"complete": 0,
"failed": 0,
"lost": 0,
"queued": 0,
"running": 0,
"starting": 0,
"unknown": 0
},
"children": {
"dead": 12,
"pending": 0,
"running": 0
},
"datacenters": [
"dc1"
],
"id": "nightly-backup",
"link": "https://nomad.example.com:4646/ui/jobs/nightly-backup@default",
"name": "nightly-backup",
"namespace": "default",
"parameterized": false,
"parent_id": "",
"periodic": true,
"priority": 50,
"status": "running",
"stopped": false,
"submitted_at": "2026-11-02T09:14:03Z",
"type": "batch"
}
],
"namespace": "default",
"truncated": false
}List nodes
List the nodes (client machines) with their status, whether they are draining or take new work, and their working drivers, or only those with a status, such as down.
Inputs
- Status
statustext - Only nodes with this status.One of:
any(Any status),ready,down,disconnected,initializing. Default:any.
Outputs
by_statusobject- How many listed are in each status
countnumber- How many are listed
drainingnumber- How many listed are draining
ineligiblenumber- How many listed don't take new work
nodeslist- The nodes, by name
Example output
{
"by_status": {
"ready": 1
},
"count": 1,
"draining": 0,
"ineligible": 0,
"nodes": [
{
"address": "10.0.0.21",
"datacenter": "dc1",
"drain_status": "",
"draining": false,
"drivers": [
"docker",
"raw_exec"
],
"eligibility": "eligible",
"eligible": true,
"id": "52aa801d-ad79-af47-6667-2dfe52faf893",
"link": "https://nomad.example.com:4646/ui/clients/52aa801d-ad79-af47-6667-2dfe52faf893",
"name": "worker-1",
"node_class": "",
"node_pool": "default",
"short_id": "52aa801d",
"status": "ready",
"status_description": "",
"version": "2.1.1"
}
]
}Put variable
Set keys of a Nomad Variable, such as a new database address for jobs to read, creating it if it isn't there. Other keys stay unless 'Replace every key' is on.
Inputs
- Path
pathtextRequired - The variable's path, as Nomad's Variables page shows it, such as apps/web/config.
- Keys and values
itemsobjectRequired - Each key and its value, such as db_host and 10.0.0.5.
- Replace every key
replacetrue/false - Keep only these keys, removing any others the variable has.Default:
false. - Only if unchanged since
cas_indexnumber - A modify index from 'Get variable': the change is refused if anything changed the variable since. 0 writes only if it doesn't exist yet. Leave blank to write whatever is there.At least 0.
Outputs
createdtrue/false- True when the variable is new
itemsobject- Its keys and values now
keyslist- Its keys now
linktext- A link to the variable in Nomad
modify_indexnumber- Its modify index now
namespacetext- The namespace, such as default
pathtext- The variable's path
removed_keyslist- Keys it had that 'Replace every key' removed
Example output
{
"created": false,
"items": {
"db_host": "10.0.0.6",
"feature_x": "on"
},
"keys": [
"db_host",
"feature_x"
],
"link": "https://nomad.example.com:4646/ui/variables/var/apps/web/config@default",
"modify_index": 231,
"namespace": "default",
"path": "apps/web/config",
"removed_keys": []
}Restart allocation
Restart a running allocation's tasks where they are, such as to pick up a changed setting, or only one task.
Inputs
- Allocation
allocation_idtextRequired - The allocation, by its ID or the 8 characters Nomad shows, such as 8d2f1c3a. 'List job allocations' gives it.
- Task
tasktext - Only this task. Leave blank to restart every task.
Outputs
allocation_idtext- The allocation's ID
job_idtext- Its job
linktext- A link to the allocation in Nomad
nametext- Its name, such as web.web[0]
restartedtrue/false- True: Nomad restarted it
tasktext- The task restarted; empty when every task was
Example output
{
"allocation_id": "8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01",
"job_id": "web",
"link": "https://nomad.example.com:4646/ui/allocations/8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01",
"name": "web.web[0]",
"restarted": true,
"task": ""
}Run job
Submit a job file to Nomad, like nomad job run: a new job starts, and a changed one is updated (rolling out as its update block says). The file is HCL, or the job's API JSON.
Inputs
- Job file
spectextRequired - The job file's contents, such as what is in web.nomad.hcl, or the job's API JSON.
- Variables
variablesobject - Values for the job file's variables, such as image_tag and 1.4.2. HCL files only.
- Only if unchanged since
check_indexnumber - The job modify index from an earlier 'Run job': the job is refused if anything changed it since. 0 runs it only if it doesn't exist yet. Leave blank to run it anyway.At least 0.
Outputs
createdtrue/false- True when the job is new
eval_idtext- The ID of the evaluation Nomad made to act on it
job_idtext- The job's ID
job_modify_indexnumber- The job's modify index now; give it to 'Only if unchanged since' next time
linktext- A link to the job in Nomad
namespacetext- The namespace, such as default
typetext- service, batch, system or sysbatch
versionnumber- The job's version now; 0 for a new job
warningslist- What Nomad warned about the job, if anything
Example output
{
"created": false,
"eval_id": "bc136b83-9d50-1a3a-8e56-18d7f7d7abb0",
"job_id": "web",
"job_modify_index": 1042,
"link": "https://nomad.example.com:4646/ui/jobs/web@default",
"namespace": "default",
"type": "service",
"version": 5,
"warnings": []
}Run periodic job now
Start a run of a periodic job now rather than at its next scheduled time, such as a backup before a change.
Inputs
- Job
job_idtextRequired - The periodic job's ID, as Nomad's Jobs page shows it, such as web.
Outputs
eval_idtext- The ID of the evaluation Nomad made to act on it
job_idtext- The periodic job
linktext- A link to the run in Nomad
run_job_idtext- The run it started, such as nightly-backup/periodic-1794347625
Example output
{
"eval_id": "b76ffe39-e8f2-90ab-b6df-a85d6850c91f",
"job_id": "nightly-backup",
"link": "https://nomad.example.com:4646/ui/jobs/nightly-backup%2Fperiodic-1794347625@default",
"run_job_id": "nightly-backup/periodic-1794347625"
}Scale task group
Change how many copies of a job's task group Nomad runs, such as more web servers for a sale, or 0 to pause it.
Inputs
- Job
job_idtextRequired - The job's ID, as Nomad's Jobs page shows it, such as web.
- Task group
grouptext - The task group to scale. Leave blank when the job has only one.
- Count
countnumberRequired - How many to run, such as 3.At least 0.
- Reason
messagetext - Why, shown in the job's scaling history, such as Black Friday.
Outputs
countnumber- How many it runs now
eval_idtext- The ID of the evaluation Nomad made to act on it
grouptext- The task group
job_idtext- The job's ID
linktext- A link to the job in Nomad
previous_countnumber- How many it ran before
warningslist- What Nomad warned about, if anything
Example output
{
"count": 5,
"eval_id": "bc136b83-9d50-1a3a-8e56-18d7f7d7abb0",
"group": "web",
"job_id": "web",
"link": "https://nomad.example.com:4646/ui/jobs/web@default",
"previous_count": 3,
"warnings": []
}Set node eligibility
Stop Nomad placing new allocations on a node, leaving what runs there alone, or let it place them again.
Inputs
- Node
nodetextRequired - The node (client machine), by its name or ID, such as worker-1.
- Takes new work
eligibletrue/false - On to let Nomad place new allocations on it, off to stop it.Default:
true.
Outputs
addresstext- Its address
datacentertext- Its datacenter
drain_statustext- How its last drain went: draining, complete or canceled; empty if never drained
drainingtrue/false- True while it is being drained
driverslist- The task drivers working on it, such as docker
eligibilitytext- eligible or ineligible
eligibletrue/false- True when Nomad may place new work on it
idtext- The node's ID
linktext- A link to the node in Nomad
nametext- The node's name
node_classtext- Its node class, if it has one
node_pooltext- Its node pool
short_idtext- The first 8 characters of its ID, as Nomad shows it
statustext- initializing, ready, down or disconnected
status_descriptiontext- Why it has that status, when Nomad says
versiontext- The Nomad version it runs
Example output
{
"address": "10.0.0.21",
"datacenter": "dc1",
"drain_status": "",
"draining": false,
"drivers": [
"docker",
"raw_exec"
],
"eligibility": "ineligible",
"eligible": false,
"id": "52aa801d-ad79-af47-6667-2dfe52faf893",
"link": "https://nomad.example.com:4646/ui/clients/52aa801d-ad79-af47-6667-2dfe52faf893",
"name": "worker-1",
"node_class": "",
"node_pool": "default",
"short_id": "52aa801d",
"status": "ready",
"status_description": "",
"version": "2.1.1"
}Stop allocation
Stop one allocation, such as a stuck one; Nomad places a new one for its job, on the same node or another.
Inputs
- Allocation
allocation_idtextRequired - The allocation, by its ID or the 8 characters Nomad shows, such as 8d2f1c3a. 'List job allocations' gives it.
Outputs
allocation_idtext- The allocation's ID
eval_idtext- The ID of the evaluation Nomad made to act on it
job_idtext- Its job
linktext- A link to the allocation in Nomad
nametext- Its name, such as web.web[0]
Example output
{
"allocation_id": "8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01",
"eval_id": "70a945f2-6558-d739-fa76-11ed722f95c7",
"job_id": "web",
"link": "https://nomad.example.com:4646/ui/allocations/8d2f1c3a-5b7e-4a10-9c2d-0e6f7a8b9c01",
"name": "web.web[0]"
}Stop job
Stop a job: Nomad stops all its allocations. A stopped job can be run again; purging also removes it and its history from Nomad for good.
Inputs
- Job
job_idtextRequired - The job's ID, as Nomad's Jobs page shows it, such as web.
- Purge
purgetrue/false - Also remove the job and its history from Nomad, for good.Default:
false.
Outputs
eval_idtext- The ID of the evaluation Nomad made to act on it
job_idtext- The job's ID
linktext- A link to the job in Nomad; empty once purged
purgedtrue/false- True when it was also purged, for good
stoppedtrue/false- True: the job was stopped
Example output
{
"eval_id": "70a945f2-6558-d739-fa76-11ed722f95c7",
"job_id": "web",
"link": "https://nomad.example.com:4646/ui/jobs/web@default",
"purged": false,
"stopped": true
}