# Workflow

Take your automation to the next level with the Workflow feature. You can create complex logic and automations by combining actions, feedbacks, variables, and utility nodes. Build custom behaviors that respond to your specific needs! Workflows also support custom variables and expression-based logic for maximum flexibility. The anatomy of a Workflow Node Each Node will look differently but there are some common features. Down the left side of the node there may be some yellow and/or white dots, these are input connections and similarly down the right side of the node there may be a number of yellow and/or white dots and these are output connections. The yellow dots are Event connections and the white are Value connections Some nodes will require a connection to be made and some will offer the connection as an option for setting the value, these inputs are vertically aligned with the option they will set. Typically a yellow dot which is not aligned with a settings box will trigger the whole node to preform something when a change is detected on the input. Any Inset colored dot aligned with a connection selection (green, yellow, red) will indicate the state of the connection hopefully it will be green indicating that the connection is connected and ok.If a Node has a red outline and a red warning triangle there is something wrong with the node configuration or connection and will possibly keep the workflow to function as expected Value Values are the main way of connecting nodes. It provides a deterministic way of dealing with conditions and logics. You can use utility nodes to alter them and chain them together, to create reactive behaviour. Event Events are processed individually, and can be used to trigger actions at a specific point in time. They can accept both values and other events. When a value is connected, it will respond whenever the value changes. Variable Types Variables are often divided in to the type of content they can hold, this is called data type or often just type In buttons we use 4 different data types. Strin g: The string variable is sort of a "catch all" and will contain anything not explicitly belonging in any of the other data types. The String variable can be empty. Number: If you need to do number operations with a variable, like math operations, enumerating or counting you should be using the Number type of variables. A number variable can not be empty. Boolean: The boolean variable is used for strictly logical values and can only hold 1 of 2 values it's either true or false. The Boolean variable can not be empty. Connection type: The Connection type variable is a specialty variable in buttons, and will hold a reference to any of the configured connection on the system. The variable is used to programmatically swop connections in buttons. Not to be confused with the Connection variable which is a set of variables tied to, and coming from the configured connections. Connection Connection Variable The Connection Variable Node allows for any variable originating from the Connection to be read in to the workflow. The Node has one Value output Connection Action The Connection Action Node Allows you to execute any of the connection actions available in your configuration. It has a Event input that will trigger the action on any change. There is as also an Execute on startup option, which will trigger the action on restart of the Workflow or Buttons. The Execute on change will trigger anytime any Value or Event input on the node changes. You can select the Connection and Action by connecting a variable to the Value input or by selecting them from the dropdown lists. Which optional inputs that will be available will depend on the connection. In the example to the right we have an Blackmagic Hyperdeck. You can select the Action to be used, either by connecting a variable to the Action input, or selecting it from the dropdown list. You can set the playback speed by connecting a numeric, or string value. You can also use Boolean value for turning on/off variable speed, Loop Clip, or Single clip playback. Connection Feedback The Connection Feedback Node is used to get a Boolean value from a connection, where the target feedback state is either true or false. Workflow Workflow Variable The Workflow variable node has a global scope, and can be utilized everywhere in Buttons. Every variable needs a unique name, and a type either string (default), number or boolean. You can also set the variable to persist through a restart, or set an initial value for the variable. The Node has a Event input Write allowing acceptable values for the current type of the variable, and a Value output Read which will give the current value of the variable in the type set in the workflow variable. Workflow Variable Read The Workflow Variable Read Node, can be used to read values from any workflow variable in the configuration, either in the same Workflow, or from other Workflows. The Value will be of the type set in the variable. Workflow Variable Write The Variable Write Node can be used to write to any workflow variable in your configuration, Either in the same workflow, or in other workflows. It has an event input that will accept any value acceptable for the receiving Workflow variable. Workflow Router The Workflow Router Node lets you crate a router for variables, giving you the ability to route variables from a input to one, or more output with the router section, Router UI and Router presets in buttons. It can be setup with a number of inputs and and outputs. It can also be expanded with a number of levels for each of the inputs and outputs giving you the ability to route multiple variables in parallel. Internal Internal Action The Internal Action lets you execute a number of internal actions, The options and settings will vary between the different internal actions. Internal Feedback The Internal Feedback Node will give you a boolean result based on the state of an internal feedback, like Route status or Connection status. Position NFC Reader The NFC Reader Node lets you read a NFC card or key fob, either system wide or for a specified position. There are 4 output values available. The serial of the NFC. The UID of the Surface used to read the NFC. The UID of the Position where the surface is located. And the Timestamp when the NFC was read. API OSC Listener The OSC Listener lets you receive OSC message from external devices or applications. you can edit the port the OSC server should be listening on, and you can create multiple Paths with or without arguments. Each path will have an Event output and a value output for the arguments contained in the OSC message. Rest Server The Rest Server Node lets you establish a rest server within a workflow that can send and receive data to and from external devices or software. You have to set the port that the server should be listening on and you can also set a limit to the number of requests pr second. You can also setup a bearer token for authentication on the remote client/server You can define both GET requests and POST requests. Remember that you are defining a server, so the GET request will require some form of input to be delivered to the requester like the content of a Variable, and the POST request will deliver some form of output from the requester. Utility Event Switch The Event Switch Node lets you define a number of events that will deliver a given Value to the output Each event input can be given a Name, Value Type of the Value, the default type is String, but you can also set it as a Number, or a Boolean. You can also set a Initial value which also is the Value that wil be used if you trigger the reset input. Priority Stack The Priority stack node lets you determine what order the input states changed to true. This can be used to determine the winner of a race. Select from 4 strategies: Latest, Most recent, Top, or Bottom. Each input can be given a name, and a value. The Value output will be the "winning" input, while the ordered output will show the "placement" in a comma delimited string, in accordance with the priority mode. Math The Math node will perform basic math from 2 input values, or an input value and a static value. You can also set the Math operator with an input, if it needs to be determined at runtime, The Math Node will accept both strings, and numbers as inputs, and will perform math operations with numerical strings (Numbers cast as string type). You can also use the Math Node to recast a Numerical string to a Number type. The output value from the Math Node will be of the number type. Clamp The Clamp node will set a upper and lower limit for a numeric value, useful for situations where you have to make sure that a incoming value is not out of bounds, resulting in an error in a connection. Logic The logic node lets you compare 2 inputs, or an input and a static value. You can compare both the values, and type to make the comparison as accurate as possible. You can also use an input to select the logic operator. The output will be a boolean value. Change Switch The change switch wil take a boolean input, and output a timestamp for each of the outputs in accordance with whether the input is true or false, allowing for multiple concurrent equal values, to repeatedly trigger a event input. Change switch will also split the true and false values to it's own outputs, acting as a trigger filter for event inputs. Case Switch The case switch will output a single case input value based on the select input. You can define your own "selectors" for each input. You can also add a default input which will be output when no match is achieved Static Value The static value lets you set a constant value of a given type and use it as a input for other nodes. String Merge The string merge lets you combine several strings in to one. You can also set the delimiter you want to use between the input strings. The output wil be a single string Counter The Counter node allows you to count up or down, either by triggers or a given amount on the various event inputs, You can also set a start value, and reset the counter, the output from the counter is a number. Delay The delay node lets you delay the payload through the passthrough either by a given value on the delay input or by entering the time in milliseconds in the value box Interval The interval timer node wil output a timestamp increasing with the given Interval in milliseconds.Output as a value, and an event Event Order The event order node will only give a true state out if the incoming events come in the given order. In reset mode the node will reset if a out of order event happens. In Wait mode the node will wait for the next in order event to come before it will allow progression. In other words Reset will enforce events only happening in the right order, while wait mode will allow for events happening in random order but will only be fulfilled when all events have happend in it's right place in the order. Scheduler The scheduler node will output a timestamp or an event increasing by the schedule you can set your interval from once a year to once every second. The node is loosely based on Cron, a time based job scheduler in Unix like operating systems, allowing users to automate repetitive tasks—known as cron jobs—by running commands or scripts at specific, fixed intervals, times, or dates State Gate The state gate will only passthrough the Payload input to the Value output if the gate is open, you can control the gate either with a state input or a set of events. There is also a fallback value that can be passed through to the value output if the gate is closed. The Is Open output will be True when the gate is open. Event Gate The event gate will only passthrough the Event to the Ou t output if the gate is open, you can control the gate either with a state input or a set of events. The Is Open output will be True when the gate is open. Display The display node wil show the value, and type of the input. Making debugging easier, and giving you realtime information inside the workflow. Expression Create complex logic in textual form. Do math, lookups, logic operations, and more.
