watsonx Orchestrate

watsonx Orchestrate

Connect with experts and peers to elevate technical expertise, solve problems and share insights.

 View Only

Building workflows with AppConnect skills in IBM watsonx Orchestrate’s Skill studio

By Benjamin Chen posted 27 days ago

  

In watsonx Orchestrate Skill studio, you can build workflows to automate certain tasks. You can also use various third-party apps and skills featured in the Skill Catalog to build automations based on your needs. 

You can build different skill types: decisions, workflows, generative AI, and document extractor. Here, we will focus on building an automation that calls specific skills in a workflow. 

The outcome of this workflow is to automatically send reminder emails to people to review ServiceNow Knowledge Base articles that are in “draft” state. You’ll build this workflow with the following features: 

  • An initial filter input to find ServiceNow knowledge articles in “draft” state 

  • The ServiceNow skill “Get all knowledge articles” 

  • The Microsoft Outlook skill “Send an email” 

  • A for-each control that will loop through each knowledge article instance 

Prerequisites: 

  • Configure and connect your apps before you start building the workflow that we’ll describe in this article. Go into Skill catalog to see what apps and skills you can use in watsonx Orchestrate. For more information about the Skill catalog, including how to connect to apps, see the IBM Docs: Exploring the Skill catalog  

  • Understand the basics of Skill studio. For more information about how to create projects and skills, see the IBM Docs: Building projects  

  • Understand how to create a workflow. For more information, see the IBM Docs: Creating workflows  

Building the workflow 

Connecting apps and skills in Skill catalog 

  1. Open the side menu in watsonx Orchestrate and click Skill catalog 

  1. Search for the Microsoft Outlook and ServiceNow apps. For each one, click Connect app and follow the procedures to connect credentials: 

  1. After credentials are connected in each app, add the following skills to your skill set: 

    • Send an email skill in Microsoft Outlook 

    • Get all knowledge articles in ServiceNow 

A screenshot of a computer

AI-generated content may be incorrect.A screenshot of a computer

AI-generated content may be incorrect.

Create a new project and a workflow skill in Skill studio 

  1. Open Skill studio and click Create > Project. 

  1. Name your project and click Create. 

  1. In your new project, click Create skill and select Workflow. Name your workflow, then click Create. 

You can see your workflow in the Diagram tab, with an Activity user task created by default. 

 Add activities and controls to the workflow 

  1. After the Activity user task, click the plus sign and select Skill from catalog, then search for the ServiceNow app and add Get all knowledge articles. 

  1. Add a “for-each” control. 

  1. Within the for-each loop, add the Microsoft Outlook skill “Send an email”.   

 Your workflow should now look like this: 

 

Configuring components 

Data Mapping for “Get all knowledge articles” skill 

The next step is to define the data mapping for the “Get all knowledge articles” skill. Create data mapping for following variables for input and output mapping: 

  1. In the Activity properties for this skill, click Define data mapping, and define the following input and output variables: 

    • Input mapping: filter 

    • Instances (output mapping) 

  1. Click OK to save your changes. 

A screenshot of a computer

AI-generated content may be incorrect. 

A screenshot of a computer

AI-generated content may be incorrect.

The “filter” data mapping refers to the filter input that you provide at the beginning of the workflow. The “instances” output is referenced in the next steps of the workflow. 

Configure User Task component and set input variable 

  1. Click the Activity user task at the beginning of the workflow and rename it to Filter input. 

  1. Click Edit user interface to add the Filter variable to the user task. 

 

  1. Go back to your workflow and click the Variables tab. 

  1. Switch the Input toggle to Yes for the “filter” variable 

 

Data mapping and variable values for “Send an email” skill 

Now let’s define the input and output variables for the “Send an email” skill. 

  1. Select the skill in the diagram and in the Activity properties panel, click Define data mapping. 

  1. Fill the Subject and toRecipientsRequested variables with the subject line and the email address that the message is being sent to. 

 

  1. Expand the body variable to show Content and content type, where Content is the body of the email. In this example we will use an expression to set the string value “Please check the draft of KB number” along with the number of InputItem.

 

To learn more about using expressions in variable values, see the IBM Docs: https://www.ibm.com/docs/en/watsonx/watson-orchestrate/current?topic=workflows-expressions-in 

Tip: 

You can see what variables can be referenced for an instancesType structure by expanding the data mapping for InputItem. 

A screenshot of a chat

AI-generated content may be incorrect. 

Trying out the workflow 

Filter input for “Get all knowledge articles” skill 

The first step of the workflow is a user task where the user provides a filter input string that is passed into the “Get all knowledge articles” skill, which you need to configure here.  

  1. Click on the blue preview button on the top right to create a new preview instance. You will then be prompted to provide the filter input string. Use the following filter input: 

          {"where":{"workflow_state":"draft"}} 

  1. Click Run. 

 

 

 

For more information about how to use filter inputs and what query parameters are available for each skill, see the IBM Docs: https://www.ibm.com/docs/en/watsonx/watson-orchestrate/current?topic=skills-filter-input 

Tip: 

You can try out a particular skill in the main Chat page in watsonx Orchestrate. In this example, we can invoke the same “Get all knowledge articles” skill to see what kind of information/data is presented. You can see what kind of query parameters can be used in filter inputs, whether it’s in the chat or in Skill studio. 

A screenshot of a chat

AI-generated content may be incorrect. 

A screenshot of a computer

AI-generated content may be incorrect. 

To learn more about using the legacy chat interface, see the IBM Docs: https://www.ibm.com/docs/en/watsonx/watson-orchestrate/current?topic=using-legacy-chat 

Going through the workflow 

  1. Click the user task to continue through the workflow. You can see the filter string that you provided as input when creating the Preview instance is passed into the user task, and subsequently into the “Get all knowledge articles” skill. 

  1. Confirm that the filter input is correct and then click Submit to continue running through the workflow. 

 

  1. After the workflow is completed, you can see that separate emails have been sent for Knowledge Base articles set in the “draft” state. 

Takeaways 

After this walkthrough of Skill studio, you will now be able to do the following: 

  • Create projects and workflow skills in Skill studio 

  • Utilize third-party apps and skills in a workflow automation 

  • Configuring components in a workflow 

This particular example showcases just a few features that you can use to build out an automation. I would encourage you to explore other functionalities in Skill studio/watsonx Orchestrate to get a better understanding of how you can leverage these features to better fit your business needs. 

Special thanks to @Margaux Chatelain @Mithun Katti @JUSTIN WANG @Tony Duong and Darshan Bulsara for their collaboration on this blog post.

 

0 comments
16 views

Permalink