Workato is an Enterprise-level automation platform service provider and offers an out-of-the-box way to quickly and easily connect and integrate with hundreds of business applications.
The Workato service provides customers the ability to build 'Recipes' that connect disparate systems together. These Recipes use ‘Connectors' to connect to various systems such as WoodWing Assets 6.
Connectors encapsulate the APIs of the target system and provide user interface elements that help a person, who may not be a developer, to create these connections.
This article describes how to use the Assets 6 Connector for connecting Workato with the WoodWing Assets 6 system.
Connector components
A Connector will have 2 parts:
- A Trigger which sets the Recipe in action.
- An Action which is an action that can be performed within the Assets 6 system.
Each is explained in detail below.
Triggers
Every recipe must have a ‘Trigger’.
Example: A trigger could be waiting for a Webhook to be sent to it. A trigger could also be a polling operation that queries the source system every x minutes to see if there is any work to do.
It’s also important to note that Triggers can have ‘conditions’. For example, an event can be sent to a Recipe and the trigger can qualify the event by adding a condition such as ‘if the status equals 'New’, and then continue on with the recipe.
Within a Connector, the Trigger is responsible for the following:
- Logging into the Assets 6 system using a connection and creating a Webhook within the Assets 6 system. The Webhook will then send data to the Recipe for processing. (To learn more about Assets 6 and Webhooks, see Working with Webhooks in Assets 6 Server.)
- Deleting the Webhook from the Assets 6 system when a recipe is stopped.
Webhook schema
One of the key parts of creating a Trigger is including the 'Webhook schema'. This schema dictates what metadata the Webhook will send to the recipe.
Setting up the Webhook schema is a 3-step process:
- Defining the metadata fields to be sent from Assets 6.
- Running the recipe so that the output is generated.
- Converting the output to JSON-format and adding it to the schema.
Each step is described in detail below.
1. Defining the metadata fields to be sent from Assets 6
In this step, the metadata that we want to work with is defined.
Example: If we want the trigger to be activated when the Status field is changed, we would define the Status field here.
Step 1. With the 'New event in Assets' trigger selected, click add fields manually in the Webhook schema section.
The Add new field dialog appears.
Step 2. Enter a name, set the correct data type and click Add field.
In the following example, we are after the Status field, defined as a string data type.
Step 3. Add more fields when needed.
Step 4. Fill out the rest of the recipe fields:
- Recipe name
- Event
- Metadata to include (fields that you want to work with later on in the recipe such as status and filename)
Step 5. Save the recipe.
2. Running the recipe so that the output is generated
In this step, the recipe is run so that output is generated which we can use to set up the schema properly.
Step 1. Run the recipe by clicking Test recipe and make sure that the trigger is activated.
Example: When Asset Update Metadata was used as the Event of the trigger, change some metadata of a file.
Step 2. Assuming that the job was processed successfully, select the trigger step to make the panel on the right side appear.
The Output tab is shown by default. It contains the code that we need to further set up the schema.
Step 3. Click Copy raw JSON.
3. Converting the output to JSON-format and adding it to the schema
In this step, the copied code is used for fully setting up the Webhook schema.
Step 1. Return to the editing mode of the recipe.
Step 2. In the trigger step, click Clear in the Webhook schema field to clear all added fields. Confirm the action.
Step 3. With the field cleared, click Use JSON.
The Generate schema dialog appears.
Step 4. In the JSON sample field, clear its content and paste the copied code.
Step 5. Click Next, followed by Generate schema.
The Webhook schema field is now filled, based on the content of the JSON code.
Step 6. (Optional) When additional fields are needed later on in the recipe, add these to the Metadata to include field, test the recipe and update the schema by following steps 2 - 5.
Triggers and Events
A Trigger event is what a Recipe receives that can... trigger the recipe to start. Every recipe must have a Trigger.
A trigger could be waiting for a Webhook to be sent to it. A trigger could also be a polling operation that queries the source system every x minutes to see if there is any work to do.
A Trigger corresponds with an actual EVENT that takes place in Assets 6. For instance, if a user creates a new image in Assets 6 then the recipe will receive an 'Asset Create' Event from Assets 6 via a Webhook that the recipe will create in Assets 6 when the recipe is started.
When configuring a Trigger you can choose to have one event serve as the trigger or have multiple events trigger the recipe.
The following is a complete list of the Actions that are supported within the connector:
- Abort Checkout Object
- Browse Folder
- Checkout Object
- Copy Asset
- Create AuthKey
- Create Folder
- Create Object
- Create Relation
- Custom Action
- Download File
- Move Asset
- Promote Asset
- Remove Relation
- Retrieve Asset History
- Revoke AuthKey
- Search Object
- Send E-mail
- Update AuthKey
- Update Object
- Update bulk Objects
- Zip Download
In the following figure, the 6 of the 21 available Events are seen with 1 selected. The blue checkmark indicates that, in this part of the recipe, the ‘Asset Create’ event is selected. It is possible to select more than 1 event and those that are selected appear at the top of dialog.
Figure: Event Selection dialog in the Trigger setup.
Actions
Once the Recipe has received a Trigger event, the next steps are to act on the incoming Event.
For instance when an Asset is created we then want to get tags from a service and save those as metadata for the image. To do that we first need to get the preview of the image from Assets 6. The process of retrieving the preview from Assets 6 consists of several Actions.
The Assets 6 Connector currently has the following types of support for configuring a large percentage of the API calls provided by Assets 6 Server:
- 'Direct’ support of an API call in which the Connector has a user interface component with which the user can configure that specific Action.
- 'Indirect' support in which a call can be made to the API using the Connector but only by using the 'Custom Action'.
Direct Support of Actions within the Connector
For those API calls that are directly supported via the Connector, the Actions appear in the Connector when a user creates an Action in the recipe and the selects the connector. In the figure below a subset of the Actions are visible on the right side of the image.
Figure: Action Selection dialog within the Connector
Custom Actions in the Connector
Assets 6 Server API calls that are supported indirectly use the ‘Custom Action’ portion of the Connector. These calls require the user to specifically add the call parameters to the URL being sent to Assets 6.
Example: To send an e-mail using the 'email' API call, the user will need to configure the URL to be something like ‘https://my.assets.server.com/email’ along with any other parameters that are required.
The following table shows the available API calls for Assets 6 Server and how they are supported within the Assets 6 Connector.
1 As part of the purchase of WoodWing Connect, the customer is provided with an API License for WoodWing Assets 6 and 2 licenses for WoodWing Studio: an API license and a Planning API license. Additional licenses can be purchased.
2 Task usage is subject to fair use. Task overage will be evaluated for next year.
Other APIs
The above list of API calls does not correspond directly to all API call information documented within WoodWing's Help Center documentation for Assets 6.
The missing API calls are listed below along with the reason they are not supported.
Assets 6 API call | Documentation | Notes |
---|---|---|
Browse | Assets 6 Server REST API - browse | Not applicable. |
Error handling | Assets 6 Server REST API - error handling | Describes how to handle errors coming back from the API. |
Localization | Assets 6 Server REST API - localization | Not applicable. |
Login | Assets 6 Server REST API - login | This call is used to log in to Assets 6 for a specific user. The connector uses the ‘apilogin’ call to make use of the features available with that call. |
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.