Schedule icon
Webhook icon
Request icon
Get icon
Commands icon
Process icon
If icon
Set icon
Log icon

Detect Public IP Changes with the KV Store

Fetch your public IP, compare it with the last value in the KV store, and flag changes. Schedule and webhook triggers, no secrets or Docker needed.

Categories
Infrastructure

Home labs, VPNs and NAT gateways change their public IP without telling you, and then allow-lists and firewall rules quietly stop matching. This blueprint checks the egress IP, remembers it, and flags the moment it changes.

How it works

  1. fetch_ip (io.kestra.plugin.core.http.Request) asks an IP service for the address your worker's traffic comes from.
  2. read_last_ip (io.kestra.plugin.core.kv.Get) loads the IP saved by the previous run.
  3. compare_ip (io.kestra.plugin.scripts.shell.Commands, Process runner) validates the response looks like an IP, then reports first_run, unchanged or changed through the ::{"outputs": ...}:: protocol.
  4. handle_result (io.kestra.plugin.core.flow.If) saves the new IP and logs a WARN when it is new or changed, otherwise logs that it held steady.
  5. Triggers: a Schedule every 15 minutes (shipped disabled) and a Webhook (public-ip-check) for on-demand checks.

What you get

  • A saved record of the last known egress IP in the KV store.
  • A WARN log, with the old and new address, the moment it changes.
  • current_ip and status outputs you can reuse from a subflow.

Who it's for

  • Home-lab and self-hosting users on a dynamic IP.
  • Teams whose partners allow-list their NAT or VPN address.
  • Anyone debugging "it worked yesterday" firewall problems.

Why orchestrate this with Kestra

The check itself is one HTTP call. Kestra supplies the memory between runs (the KV store), the schedule, the branch on change, and an execution history that shows exactly when the address moved.

Prerequisites

  • No secrets, Docker or extra services.
  • The Kestra worker needs outbound HTTPS access to the IP service.
  • A sh shell and grep on the worker, which any Linux Kestra image has.

Inputs

  • ip_service_url (URI, default https://api.ipify.org?format=json): any endpoint that returns {"ip": "..."}.
  • kv_key (STRING, default public_ip_last): KV key where the last IP is stored.

Quick start

  1. Save the flow and click Execute. The first run reports first_run and stores your IP.
  2. Execute again. It should report unchanged.
  3. To see a change, edit the public_ip_last value in the namespace KV store to a different IP and run again. It reports changed.
  4. Enable the every_15_minutes trigger when you are happy.

Example outputs

  • outputs.current_ip: 203.0.113.7
  • outputs.status: unchanged

How to extend

  • Replace log_change with a Slack, email or Jira task to notify your team.
  • Add a call to your DNS provider to update a record when the IP changes.
  • Keep a history by also writing each change to a KV key with a timestamp.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.