Portal Community

When to Use

  Restart reuses the original container configuration. It does not pull a new image or apply new environment variables. If you need to update image or environment, use the create-stop-remove-create-start pattern instead.

Configuration

Connection Fields

FieldTypeDefaultDescription
dockerHoststringunix:///var/run/docker.sockDocker socket path or TCP endpoint
connectionTypestringunixsocketunixsocket | tcp | tcptls
tlsCertPathstringTLS certificate directory. Required for tcptls. optional
timeoutSecondsint30Grace period for shutdown before SIGKILL. optional

Operation Fields

FieldTypeRequiredDescription
resourcestringrequiredMust be container
operationstringrequiredMust be restart
ContainerIdstringrequiredContainer ID (full or short) or container name

Sample Configuration

{
  "resource": "container",
  "operation": "restart",
  "ContainerId": "api-service",
  "connection": {
    "dockerHost": "unix:///var/run/docker.sock",
    "connectionType": "unixsocket",
    "timeoutSeconds": 15
  }
}

Validation Errors

Error CodeTriggerResolution
MISSING_INPUTContainerId is emptyProvide the container name or ID.
NOT_FOUNDContainer does not existVerify the container name. If the container was removed, recreate it with container/create.
DOCKER_API_ERRORDaemon error during restartCheck daemon logs. Possible causes: OOM kill during shutdown, volume unmount failure.

Output

Success Port

FieldTypeDescription
containerIdstringID of the restarted container
statusstringsuccess
resourcestringcontainer
operationstringrestart

Error Port

On failure, the error port receives errorCode, message, resource, and operation. After a restart failure on a critical service, trigger an alerting node immediately.

Sample Output

{
  "containerId": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890",
  "status": "success",
  "resource": "container",
  "operation": "restart"
}

Expression Reference

ExpressionReturns
{{ $output.containerId }}ID of the restarted container — pass to container/inspect for health verification
{{ $output.status }}success when restart completed

Node Policies & GuardRails

PolicyDetail
Verify running state after restartFollow container/restart with container/inspect and check State.Running = true. The daemon may report success even if the container exits immediately after start.
Restart does not update imageNever use restart as a deployment mechanism. Always use the full create-stop-remove-create-start sequence when updating image versions.
Limit automated restart chainsWorkflows that restart containers in response to health failures must include a cooldown or retry limit to prevent restart storms.
No remote TCP without TLSUse tcptls for remote Docker hosts.
Alert on restart failureA failed restart of a critical container requires immediate human escalation. Always connect the error port to an alerting node for production services.

Examples

Example 1: Health-check recovery automation

A monitoring workflow detects a container that is running but not responding to health pings. Restart it and verify recovery.

// Trigger: health check HTTP call returns non-200
// Node 1: container/restart
{ "resource": "container", "operation": "restart", "ContainerId": "{{ $trigger.containerName }}" }

// Node 2: Delay 5 seconds
// Node 3: container/inspect
{ "resource": "container", "operation": "inspect", "ContainerId": "{{ $trigger.containerName }}" }

// Node 4: If Condition
// State.Running === true → notify "container recovered"
// State.Running === false → escalate incident

Example 2: Nightly memory-leak mitigation

// Scheduled trigger: every day at 3:00 AM
{
  "resource": "container",
  "operation": "restart",
  "ContainerId": "report-generator",
  "connection": { "timeoutSeconds": 30 }
}
// Send Slack notification: "report-generator restarted at 3 AM for maintenance"

Example 3: Post-dependency restart sequence

// Triggered when database container restarts (via webhook or event trigger)
// Restart application containers that connect to the database:
[
  { "resource": "container", "operation": "restart", "ContainerId": "api-service" },
  { "resource": "container", "operation": "restart", "ContainerId": "worker-service" },
  { "resource": "container", "operation": "restart", "ContainerId": "scheduler-service" }
]
// Run in parallel using ParallelFork node for faster recovery