Take whichever lookup answers first
Expert
Graph structure (text alternative)
Trigger: onChatCommand
Nodes:
- On Chat Command
(entry.onChatCommand) - Race
(flow.race) - Spotify: Now Playing
(spotify.nowPlaying) - Twitch: Get Stream
(twitch.getStream) - To Text
(convert.toText) - Send Chat Message
(action.sendChat) - Return
(flow.return)
Connections:
- On Chat Command.out → Race.in
- Race.branch0 → Spotify: Now Playing.in
- Race.branch1 → Twitch: Get Stream.in
- Race.winner → To Text.value
- Race.completed → Send Chat Message.in
- To Text.value → Send Chat Message.text
- Send Chat Message.out → Return.in
Walkthrough
Fire two lookups at once and act on whichever answers first.
How it works
- On Command fires on
!status. - Race starts both branches concurrently and continues the moment the first one finishes
(
Task.WhenAny):- branch 0 → Spotify: Now Playing
- branch 1 → Twitch: Get Stream
- Race binds the winner index (
0or1) to a data output. - To Text turns the winner into a string and Send Chat Message reports it.
This is the shape you'd use to take the fastest of several sources. Swap the branches for whatever real work you need to race. See Race.
