---
title: "spark on disconnect · RUAL Documentation"
description: "Executes a given function if a spark disconnects."
canonical: https://docs.rual.nl/block-types/websocket/function_spark_on_disconnect
language: en
---

# spark on disconnect

This block is part of the [`websocket`](https://docs.rual.nl/block-types/websocket) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

Executes a given function if a spark disconnects.

- flow `flow`

- clear all `condition` Clears all previously given disconnect function

- flow `flow`

- success `condition`

- error `value`

- on disconnect `execute_function`

A typical wiring for [spark on disconnect](https://docs.rual.nl/block-types/websocket/function_spark_on_disconnect): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; the function out pin wires to an [execute](https://docs.rual.nl/block-types/function%20execution/function_custom_execute_from_trigger) block.

![Studio canvas example for the spark on disconnect block: typical wiring for spark on disconnect.](https://docs.rual.nl/canvas-examples/function_spark_on_disconnect.png)

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
