TCP Check

TCP Check

Certified

Check if a TCP port is open

Opens a TCP connection to host: port and closes it right away without sending any payload. The port is open when the connection is established within connectTimeout. A filtered port ends at connectTimeout and is reported as closed.

Use expect to fail the task when the outcome is not the one you want; with the default ANY the task never fails on reachability. An invalid host or port fails the task instead of being reported as closed.

yaml
type: io.kestra.plugin.fs.tcp.Check

Check that a database port is open.

yaml
id: tcp_check
namespace: company.team

tasks:
  - id: check_db
    type: io.kestra.plugin.fs.tcp.Check
    host: db.example.com
    port: 5432
    connectTimeout: PT3S
    expect: REACHABLE
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-fs --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties

Target host or IP

Target port

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
DefaultPT5S

Connection timeout

Between 1 millisecond and 5 minutes. Applies to the connection attempt only; the inherited task-level timeout is the overall limit.

DefaultANY
Possible Values
REACHABLEUNREACHABLEANY

Expected outcome

REACHABLE fails the task if the port is closed, UNREACHABLE fails it if the port is open or the host cannot be probed (DNS failure, no route), ANY never fails. A refused connection or a timeout counts as not open.

Formatduration

Time to establish the connection

Empty when the port is closed.

Error message when the connection failed

Defaultfalse

Whether the connection was established