Portal Community
  Live traffic impact: Disconnecting a container from a network immediately removes its reachability on that network. Any in-flight requests to the container from other containers on that network will fail. Coordinate with load balancer draining before disconnecting production containers.

When to Use

Configuration

Connection

FieldTypeDefaultDescription
dockerHoststringunix:///var/run/docker.sockDocker daemon socket path or TCP endpoint.
connectionTypestringunixsocketOne of: unixsocket, tcp, tcptls.
tlsCertPathstringTLS certificate directory. Required for tcptls. optional
timeoutSecondsint30Operation timeout. optional

Operation Fields

FieldTypeBadgeDescription
NetworkIdstringrequiredNetwork ID or name to disconnect the container from.
ContainerIdstringrequiredContainer ID or name to disconnect.

Sample Configuration

{
  "resource": "network",
  "operation": "disconnect",
  "connection": {
    "dockerHost": "unix:///var/run/docker.sock",
    "connectionType": "unixsocket"
  },
  "NetworkId": "app-backend",
  "ContainerId": "api-server-blue"
}

Validation Errors

Error CodeConditionResolution
MISSING_INPUTNetworkId or ContainerId is empty.Provide both network and container references.
NOT_FOUNDNetwork or container does not exist, or the container is not connected to the network.Treat as idempotent in cleanup workflows — the container is already disconnected.
CONFIG_ERRORConnection settings malformed.Check dockerHost and connectionType.
DOCKER_API_ERRORCannot disconnect from the default network or last network.A container must remain on at least one network unless it uses --network none.

Output

Success Port

FieldTypeDescription
statusstring"ok" when disconnected successfully.
resourcestring"network"
operationstring"disconnect"
networkIdstringThe network the container was disconnected from.
containerIdstringThe container that was disconnected.

Error Port

Fires when disconnection fails. Output contains status: "error", errorCode, and errorMessage.

Sample Output

{
  "status": "ok",
  "resource": "network",
  "operation": "disconnect",
  "networkId": "app-backend",
  "containerId": "api-server-blue"
}

Expression Reference

ExpressionReturns
{{ $output.status }}"ok" — gate network removal on this value.
{{ $output.containerId }}Container disconnected — include in deployment audit trail.
{{ $output.networkId }}Network disconnected from — use to confirm before network/remove.

Node Policies & GuardRails

PolicyEnforcement
Never expose Docker daemon TCP without TLSUse tcptls for remote connections. Plain tcp is blocked in production GuardRail profiles.
Store TLS certificates in Credentials ManagerReference tlsCertPath via {{ $credentials.dockerTlsCertPath }}.
Drain load balancer before disconnecting production containersDisconnecting without draining drops in-flight requests. Add a load-balancer drain step before calling network/disconnect in production deployments.
Never interpolate user input into NetworkId or ContainerIdNetwork and container references must come from trusted workflow variables.
Disconnect containers before removing networksnetwork/remove returns CONFLICT if containers are still connected. Always disconnect first.
Restrict container/exec to approved commandsArbitrary exec access is root-equivalent. GuardRail exec policies restrict allowed command prefixes.

Examples

Example 1 — Blue-Green Traffic Cut-Over

After connecting the new green container to the load-balancer network, disconnect the old blue container to stop traffic without stopping it.

// Step 1: Connect green (already done in previous node)
// Step 2: Disconnect blue
{
  "resource": "network",
  "operation": "disconnect",
  "NetworkId": "lb-network",
  "ContainerId": "api-server-blue"
}
// Step 3: container/stop then container/remove for blue

Example 2 — Security Incident: Network Isolation

On detection of suspicious behavior, disconnect a container from all networks to prevent lateral movement while preserving its state for forensic analysis.

// Step 1: network/inspect on each network to get connected containers
// Step 2: For each network the compromised container is on, disconnect:
{
  "resource": "network",
  "operation": "disconnect",
  "NetworkId": "{{ $loopItem.networkId }}",
  "ContainerId": "{{ $trigger.suspiciousContainerId }}"
}
// Container remains running but network-isolated

Example 3 — Pre-Remove Network Cleanup

Before calling network/remove, disconnect all containers from the network. Loop through the Containers object from network/inspect.

// Loop over Object.keys($node['network-inspect'].output.networkInfo.Containers):
{
  "resource": "network",
  "operation": "disconnect",
  "NetworkId": "ci-run-{{ $trigger.runId }}",
  "ContainerId": "{{ $loopItem }}"
}
// After loop completes: network/remove