Portal Community
  Hot-plug networking: network/connect attaches a container to a network while it continues running — no restart required. The container immediately gains DNS resolution and IP connectivity on the target network.

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 network name to connect the container to.
ContainerIdstringrequiredContainer ID or container name to connect.

Sample Configuration

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

Validation Errors

Error CodeConditionResolution
MISSING_INPUTNetworkId or ContainerId is empty.Provide both network and container references.
NOT_FOUNDNetwork or container does not exist.Verify both names/IDs. Use network/list and container/list to confirm.
CONFLICTContainer is already connected to this network.Treat as idempotent — the container already has connectivity.
CONFIG_ERRORConnection settings malformed.Check dockerHost and connectionType.
DOCKER_API_ERRORUnexpected daemon error (e.g., IP address pool exhausted).Check subnet capacity with network/inspect.

Output

Success Port

FieldTypeDescription
statusstring"ok" when the container is connected successfully.
resourcestring"network"
operationstring"connect"
networkIdstringThe network that was connected to.
containerIdstringThe container that was connected.

Error Port

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

Sample Output

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

Expression Reference

ExpressionReturns
{{ $output.status }}"ok" — gate traffic routing on this value.
{{ $output.networkId }}Network the container was connected to.
{{ $output.containerId }}Container that was connected — include in deployment audit log.

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 }}.
Gate network connection on health checkOnly connect containers to production networks after health checks confirm readiness. Never connect containers that failed startup validation.
Never interpolate user input into NetworkId or ContainerIdNetwork and container references must come from trusted workflow variables.
Always handle the error portWire the error port to alerting nodes — connection failures block inter-service communication.
Restrict container/exec to approved commandsArbitrary exec access is root-equivalent. GuardRail exec policies restrict allowed command prefixes.

Examples

Example 1 — Post-Health-Check Network Join

Start a new container, wait for its health check to pass, then connect it to the production network so live traffic can reach it.

// Step 1 — container/start
// Step 2 — container/inspect (poll until State.Health.Status === "healthy")
// Step 3 — network/connect
{
  "resource": "network",
  "operation": "connect",
  "NetworkId": "app-backend",
  "ContainerId": "{{ $node['container-start'].output.containerId }}"
}

Example 2 — Attach Monitoring Sidecar to Multiple Networks

Connect a Prometheus exporter container to all application networks so it can scrape metrics from containers on each network segment.

// Loop over target networks:
{
  "resource": "network",
  "operation": "connect",
  "NetworkId": "{{ $loopItem.networkName }}",
  "ContainerId": "prometheus-exporter"
}
// Networks: ["app-frontend", "app-backend", "app-data"]

Example 3 — Blue-Green Cut-Over

In a blue-green deploy, connect the new (green) container to the load-balancer network once it is healthy, then disconnect the old (blue) container.

// Step 1: Connect green to lb network
{ "NetworkId": "lb-network", "ContainerId": "app-green" }

// Step 2: Disconnect blue from lb network
{ "resource": "network", "operation": "disconnect",
  "NetworkId": "lb-network", "ContainerId": "app-blue" }