Set Up API Connector Output Fields in the Okta Workflows Connector Builder

This blog post will teach you how to set up output fields on an API connector action in the Okta Workflows Connector Builder. Your card will look like this:

connector outputs weather current output

The Weather – Current card.

  • Create API connector tutorials.
  • Set up API connector output fields.
  • Resources.

Create API connector tutorials

We wrote two tutorials about building API connectors in the Connector Builder:

Set up API connector output fields

This blog post will use the OpenWeather API connector.

The following flow is the Weather – Current card that returns the current weather information for a city:

connector outputs current1

Flow for the Weather – Current card.

Zooming to the end of the flow, you will see the flow passes the raw response (the body field) to the output.

connector outputs current2

The Weather – Current flow output.

When you use the card in a flow, you get the same raw response:

connector outputs weather current

The Weather – Current card raw output.

Returning raw response is suitable for a custom API action card. When you create a card for a specific API endpoint, you can define the card’s output according to the API endpoint JSON response fields.

Your card’s output will look like this instead of returning the raw response:

connector outputs weather current output

The Weather – Current card with defined outputs.

Copy the flow

Duplicate the Current flow if you want to keep the original flow and action intact.

Set up card’s output fields

  1. Open the flow.
  2. On the Return Outputs card, click Edits.
  3. Delete current output fields.
  4. Enter Weather for Group Name.
  5. Define the outputs that correspond to the API endpoint JSON response fields.

The Current weather endpoint has the following JSON format API response fields:

connector ouptut weather current docs

JSON format API response fields (source).

To also see a JSON example, use the raw response in Okta Workflows or from OpenWeather JSON format API response example.

connector ouptut weather current docs3

JSON response.

At the top, the coord object has two keys:

{
  "coord": {
    "lon": 12.4839,
    "lat": 41.8947
  },
  "weather": [
    {
      "id": 802,
      "main": "Clouds",
      "description": "scattered clouds",
      "icon": "03n"
    }
  ]
  ...
}

To create the same output, create a coord key with Object type and lon and lat properties (Number type). You will see the card’s preview on the right side.

connector outputs weather current out1

Setting card’s output.

Next, you define the weather object that is an array of objects (The weather could be several objects, like rain+mist):

connector outputs weather current out2

Setting card’s output.

Continue to define the output fields until you include the full JSON response.

connector outputs weather current out3b

Connection action output fields.

You can see the card’s preview on the right.

  1. Click Apply to save the outputs and return to the flow.

Connect data from raw response to output fields

This section will teach you how to connect data from the raw response and set the output fields.

  1. Add the Object – Get Multiple card between the Call Flow and Return Outputs cards.
  2. Using the Get Multiple card, extract data from the raw response and connect it to the output fields.

connector outputs weather getmultiple

Setting output fields.

  1. Finish connecting all the output fields.

Deploy the changes

Save all the changes and deploy a new connector version from the Deployment page.

Use the new card

Use the new Weather – Current card in a flow. The card now has new output fields you can directly connect to other cards.

connector outputs weather flow

The Weather – Current card with new outputs.

Resources

📚 Building a Custom Connector in Okta Workflows, a Video Series.

📖 Okta Workflows Connector Builder documentation.

🍫 Get help from Workflows specialists during weekly community office hours.

📺 Learn from Workflows videos.

🛟 Get help from support: discuss a Workflows topic or ask a question.

🙋🏻‍♀️ Get help from the community: join the #okta-workflows channel on MacAdmins Slack.

Tags

Workflows