Skip to content

Send message to another script

Send a value to other Flow Pro scripts by reference name and receive their replies.

Updated View as Markdown
For humans
Flow APIFlow Pro scriptingScripts and storage

This article covers the following platforms

Use script messaging to send any JavaScript value to scripts with a matching reference name.

script_message_send()

Send a message to matching scripts and receive their replies.

SignatureTypeScript contract
script_message_send(
  reference_name: string,
  message: unknown,
  callback: (reply: object) => void
): void

Parameters

NameTypeRequiredDescription
reference_namestringYesReference name of the script or scripts to find.
messageunknownYesValue to send. It can be any JavaScript value.
callback(reply: object) => voidYesFunction that receives a configured reply.
ExampleJavaScript
this.$api.command.script_message_send(
  "weather-tools",
  { action: "refresh" },
  (reply) => console.log(reply)
);

Returns

voidReplies are delivered to the callback.

Callback data

NameTypeDescription
replyobjectReply from a matching script when that script is configured to respond.
Navigation

Type to search…

↑↓ navigate↵ selectEsc close