Fail a command when a service is down
Medium
Graph structure (text alternative)
Trigger: onChatCommand
Nodes:
- On Chat Command
(entry.onChatCommand) - Connection State
(connection.state) - If
(flow.if) - Text
(data.literal.string) - Send Chat Message
(action.sendChat) - Return
(flow.return) - Fail
(flow.fail)
Connections:
- On Chat Command.out → If.in
- Connection State.isConnected → If.condition
- If.then → Send Chat Message.in
- Text.value → Send Chat Message.text
- Send Chat Message.out → Return.in
- If.else → Fail.in
Walkthrough
End a run as a failure when a service it needs is down, so the reason shows up in your logs instead of the flow ending quietly.
How it works
- On Chat Command fires on
!scene. - Connection State reads whether OBS is connected, binding its isConnected flag.
- If branches on that flag: the then path handles the connected case, the else path handles the outage.
- Send Chat Message confirms the switch, then Return ends the run cleanly.
- On the else path, Fail ends the run and writes its message to the log, so you can see why the command did nothing.
Swap the confirmation for your real scene-switch action once you are wiring this up for keeps. See Fail for how the message is surfaced, and the Ending a flow guide for when to reach for Return, Stop, or Fail.
