As a prerequisite to this guide, check out the Veritone Automate Studio User Guide for more information on using the app and the Node Palette.


The Node Palette is located on the lefthand side of Veritone Automate Studio and consists of nodes from the Node-RED community, Veritone’s proprietary aiWARE nodes, and custom nodes should you choose to create them. 

For this guide, we will focus on the core nodes within the aiWARE Node Palette that are the basic building blocks for creating flows that leverage Veritone’s aiWARE platform components including: event-driven architecture, adapters, cognitive engines, APIs, and applications. 

All nodes include documentation you can see in the Info sidebar tab when you select a node.

aiWARE Event Node

The aiWARE Event node receives event messages sent by webhook from the aiWARE eventing system and reads in the events as a payload into the flow.

The Event node is one of three ways to run a flow within Automate Studio. Logically, this node can be used to trigger a flow with a prescribed event using aiWARE’s event-driven framework such as an API call, detection of a specific face within a video, and more.

Inputs

Event

This calls out the event that the node is intended to read-in into the flow. This value corresponds to the eventName property value retrieved in the GraphQL query shown in the References section below.

Type

This field expects the eventType value that can be retrieved from the GraphQL query shown in the References section below.

App

This field expects the application value that the event is associated with. For default events, use the input system, otherwise input the GUID of the Application that the custom event is associated with.

Outputs

The payload contains the body of the aiWARE event read into the flow. The schema is displayed by including the schemaData as seen in the References section below.

Details

The field Event Name expects the name of a valid event available to the user’s aiWARE Organization (Org), either a “system” event that is default within every org or custom events either defined by or shared with that org through the Veritone Developer application.

Note: This node will only work as expected in the Automate Studio workspace runtime and will not work as expected if the flow is deployed and running as an automation engine runtime within the aiWARE platform.

References

  • aiWARE GraphiQL IDE - Link to the integrated development environment (IDE) where you can run this and other queries: 
query events{
events(application:"system"){
records{
eventName
eventType
schemaData } } }
  • aiWARE GraphQL APIs - Link to the technical documentation overview on building new and/or integrating existing applications with aiWARE.

aiWARE API Node

The aiWARE API node executes freeform GraphQL query and mutation statements with pre-handled authentication.

Inputs

url

This calls out the intended aiWARE endpoint (optional).

orgToken

Assign this variable to the organization API token performing an authorized API request on that organization (optional).

variables

Assign this variable as a JSON object that contains the properties that map to the $data flags within the GraphQL statement. See Query Variables section below for more details.

Outputs

Standard Output

payload
  • The standard output of the GraphQL call in JSON format.

Standard Error

payload
  • This outputs any errors from the API node.

Details

If your GraphQL operation was correctly structured, then the node will output data in aiWARE's GraphQL JSON format. Incorrect formatting or other errors will result in the node reporting a 400 Error.

Each API node has a createJob GraphQL statement that is used for starting an engine process using aiWARE's GraphQL API populated by default, but can be deleted and replaced with the GraphQL statement intended for execution in that node.

Here is an example of correct mustache syntax in the api node: {{payload.myVariable}}

References

  • aiWARE GraphiQL IDE - Link to the GraphQL interface to try out aiWARE's APIs yourself.
  • aiWARE GraphQL APIs - Link to the technical documentation on using aiWARE's APIs and understanding the Data Model.

GraphQL Sample

Here is a sample GraphQL query returning a list of your logged in Org’s users:

query{ users{ records{ id name firstName lastName } } }

This sample query will return the list of users in the Org with the id, name, firstName, and lastName properties included for each user record. You can of course modify this query to remove any of these properties or add additional ones.

Query Variables

Users can create a msg.variables JSON variable in a previous node (e.g. a change or function node) that maps the contained key-value pair to the $data flags within the GraphQL statement.

Here is an example:

mutation updateWatchlist ($id: ID!, $details: JSONData!){ updateWatchlist(input:{ id: $id details: $details }){ id details } }

aiWARE My Jobs Node

The aiWARE My Jobs node retrieves engine Jobs that have previously run in your aiWARE org.

Inputs

orgToken

Assign this variable to an API token for the org intended to perform this authorized API request on that aiWARE org (optional). If a value is not provided, this node will use the default API token provided for the flow or engine.

limit

Input an integer value to limit the number of Job records returned from this node.

Outputs

payload

The payload contains the Job object along with an array of Tasks object records nested in the Job payload.

Details

  • Select the desired Job and child Task fields from the node UI to be included in the payload object.
  • The Task fields selected will return for each child task nested in an array of the parent Job.

References

aiWARE Me Node

The aiWARE Me node shares general information about the logged-in user account using Automate Studio and can also be used to generate a new user session token when any aiWARE user's credentials are provided.

Note: The username and password variables can only be input through the node form UI.

Inputs

userName

This it the userName of the aiWARE user seat desired to login into.

password

This is the password for the aiWARE user seat desired to login into.

Outputs

me payload
  • Output JSON containing the information of the logged in user including user id and name.
session payload
  • The session token generated upon successfully executing a userLogin GraphQL mutation.

Details

The Me node enables users to provide their own credentials to any aiWARE org and generate a user session token for accessing objects that the user logging in may have access to. When no user credentials are provided, the node executes a GraphQL query that returns the name of the user using that particular flow when logged in:

query{ me { name } }

References

  • aiWARE API Docs - Further documentation on aiWARE user authentication and API tokens.

aiWARE Create File Node

The aiWARE Create File node creates a media file that is stored in aiWARE as a TemporalDataObject (TDO) along with a child asset that is a link to the specific media file path.

Inputs

uri

The URI expects a cloud-hosted file path for downloading the file and ingesting the file into aiWARE.

start time

Each TemporalDataObject expects a Start Time. If left blank, the Start Time will be populated with the DateTime value that the TDO was created in aiWARE.

stop time

Similar to Start Time, Stop Time expects the actual end of the media file and is used to calculate the total file duration.

content

Content Type is optional and is used for associating a pre-defined, custom schema to the media file upon creation in aiWARE. This is useful for correlating aiWARE Structured Data with Media Files.

Outputs

Payload JSON

The msg.payload will contain the TDO id and name properties along with the newly created asset properties of id, assetType, and the signedUri, which is the file path that is signed for external clients to access the media file.

Details

The TDO serves as the “Container” of a media file and any associated important information, including templated data and various permutations of the media file.

References

aiWARE Structured Data Node

The aiWARE Structured Data node can perform Create, Read, Update, and Delete operations on structured data records in aiWARE.

Inputs

record id

The Record ID field expects the ID of the Structured Data Object's (SDO) records in a selected Schema and is optional for the Query operation but required for the Update and Delete operations.

If Record ID is left blank for the Query operation, then the node returns a list of SDO records in the selected schema.

Outputs

payload

The msg.payload will vary depending on the operation selected by the user. If the Delete option is selected, then the ID of the SDO deleted will be returned in the payload. If an SDO was created or updated, then the ID will be returned in the payload.

Choosing the Query option will have the most impact on the payload structured. Selecting the Query option will enable a user to select not only the SDO ID, but any fields defined in that SDO's schema as well. The selected fields will be returned as the data type they were defined as in the schema.

Details

Both the Operation and the Schema need to be selected to perform a valid operation in this node. The Schema dropdown will list all of the Schemas available to the active user in the organization that they are logged into.

When a Schema is selected, the fields defined in that Schema will display as input fields for users to type in either a string value or a mustache syntax variable.

References

aiWARE AI Processing Node

The aiWARE AI Processing node processes a file with a cognitive engine of your choice that is available to your aiWARE org, all without writing a GraphQL statement.

Inputs

media id

The ID of the temporalDataObject (aka Media File in aiWARE) intended for processing.

Outputs

payload

The output JSON that contains the engine processing Job and the engine processing tasks defined by the user and nested in the Job object.

Details

First, select the engines you wish to process the Media File with by clicking Add task, then select the Engine Category followed by the Engines available to your org in that cognitive category.

Resources

aiWARE Engine Jobs Quickstart Tutorial - Read more about running aiWARE engine jobs.

aiWARE Engines In Node

The aiWARE Engines In node sends messages from the aiWARE engine framework, also known as the Version 2 Framework (V2F) or realtime framework, into the flow when running within the automation engine runtime. This node is specific to aiWARE's runtime and will not interact with the workspace runtime within Automate Studio.

Outputs

Media Chunk Engine Message 

payload

The standard output of the aiWARE engine framework as a message injected into the flow when running as an automation engine (runtime).

Miscellaneous Engine Output

payload

Additional miscellaneous engine messages may be routed through the flow. Be sure to check if both of the below  are also equal to media files you expect to process. See the Details section below for more info.

msg.payload.type === "media_chunk"

msg.payload.mimeType

Details

The engine in node abstracts away the aiWARE engine framework for Automate Studio users. This node is only relevant for users building flows with the intent to run those flows as automation engines that can take advantage of the runtime's abilities to horizontally scale the flow workloads.

Handling Miscellaneous Engine Messages

It is necessary to handle for additional messages that are irrelevant for the flow running as an automation engine but that are nonetheless fed into the engine queue. This is done by:

  • Evaluating the payload.Type and the payload.mimeType. If the values are not media_chunk and the expected mimeType respectively, the msg is not sent to the cognitive engine for processing.
  • Instead, the message is routed to an http response node with a statusCode of 204 that instructs the aiWARE engine framework to ignore the message.

References

  • aiWARE Engine Modes - Read more about the three types of Engine Processing Modes that run on the aiWARE engine framework.
  • Engine Testing and Debugging - Check helpful documentation on engine testing and debugging within aiWARE. Automate Studio empowers users to test within the Studio itself, this is nonetheless a good subject overview.

aiWARE Engine Out Node

The aiWARE Engine Out node processes the inbound payload prior to returning it back to the message queue of the aiWARE engine framework.

Inputs

payload

The payload is expected to be pre-formatted JSON that is then sent to the aiWARE engine framework message queue for writing the message as an engine output in aiWARE.

Details

For the most simple experience configuring automation engines, leverage the AI Processing node in the aiWARE node palette.

References

aiWARE Engine In Test

The aiWARE Engine In Test node injects a mock engine message payload into the flow for testing the various permutations of how a message could be formatted when sent to the flow while it is running as an automation engine.

Inputs

engine mode

The Engine Mode refers to how the flow is expected to process media files when running on the automation engine runtime. The choices are Chunk, Batch, and Stream - see the Automate Studio User Guide for more information. 

file type

An open string field with auto-suggested values for the different kinds of possible files.

custom fields

Use the custom fields to define the field (Key) and a mock sample of data (Value) to imitate how custom fields designated for an engine in the Veritone Developer application will impact the payload of the flow when using the automation engine runtime.

Outputs

Engine In Test Output

payload

The payload output is a JSON object that is formatted by the inputs defined by the user. This should be driven in part by the kind of engine (Cognitive or Automation) designed and the expected behavior when running.

Details

This test node is designed to dynamically mock the payloads that would be formed when the flow is running on the aiWARE engine framework.

References

  • aiWARE Engine Modes - Read more about the three types of Engine Processing Modes that run on the aiWARE engine framework.

aiWARE Objects Node

The aiWARE Objects node easily creates, queries, deletes, or updates standard aiWARE objects including Collections and Watchlists.

Inputs

object

Dropdown menu of the aiWARE object intended as the target for a specific operation.

action

Dropdown menu of the action to perform on the aiWARE object. Choices include Create, Read, Update, or Delete.

filter

When the aiWARE object and intended action have been selected, the Filters become available to narrow down the targeted aiWARE objects.

Outputs

payload

Output JSON that contains the details of the aiWARE object that was selected from the dropdown menu along with the selected fields from that aiWARE object.

Details

aiWARE API Data Model - Documentation of how aiWARE Objects relate to each other in aiWARE's API Data Model.

That All Folks (For Now)!

The Veritone Team is hard at work continuing to add new nodes to the aiWARE Node Palette that will simplify flow creation using the powerful components of the aiWARE technology stack. Let us know if there is a node you would like to see to support your use case or have feedback on the existing nodes.

Contact us on the Veritone Developer Community Slack Channel!

More Tutorials and Resources

Need help or have a question? Check out more Veritone Automate Studio resources:

Did this answer your question?