Skip to main content
Version: latest

Inputs and Outputs

This is a guide to input and output services for Agents.

Overview

An Input is the method for providing a data message to an Agent. An input message may be consumed by one or more Skills of an Agent.

An Output represents the data messages that an Agent produces. Output messages may be consumed by other Skills via a synapse or by an external data source.

Inputs and outputs to your Agent are shown on the left side of the design view and are part of the Agent definition that is stored in Cortex.

Services

Services provide a way to send data to and retrieve data from Agents.

  • Services are input-output service pairs with defined rules and schema that send HTTP requests by creating REST endpoints.

  • Cortex service calls are executed asynchronously. POSTs to the service receive a session ID that is used to retrieve a result using a GET request to the endpoint.

  • When you POST data to a service endpoint, the Cortex runtime sends that data to the Skills that are configured to receive it, via queues

Service Message Properties

Service input and output properties (as displayed in the Properties panel) include:

  • URL: The URL endpoint to access the service.
  • Message table: The schema of the data message that the input service sends to the Skill or that the output service posts from the Skill after processing. The table contains a key/value pair list of the fields and data types in the message. See the CAMEL specification for a list of the supported data types.

Creating Service Message Paths in Agents

  • SENSA Fabric allows you to link inputs and outputs to Skills graphically to configure the message-flow through agents. Input paths are displayed as blue lines, and output paths are displayed as green lines.

  • When you assemble an Agent, you must create message paths that link inputs to the actions of Skills that consume data of the specified type, and through synapses link the outputs of those actions to other Skills.

  • Input data types must correspond to the data types the Skill is configured to process and likewise the Skills' output data types must correspond to the outputs message data types. The status of the data correspondence is displayed via the Data Quality Indicators.

  • Data paths are further defined by mapping the data at the interfaces through the data quality indicators.

  • Inputs and outputs may be connected to one or more Skill actions.

  • Skill actions may be connected to one or more inputs and outputs.

Add an Input-Output Service Pair to an Agent

For simple Service Messages or services that have been added to your Project already follow the steps below. To configure more complex Service Messages go to the Service Messages page.

  1. At the top right of the Inputs or Outputs panels click ADD and select Service (or in top menu click Add > Input or Output > Service).

  2. In left panel give the Input Service a unique name within the agent.

    The "Service Name" is an identifier that is used in service calls. The value you enter must be a valid string for use in URLs.

  3. In the right panel configure the message type for the input portion of the service in one of two ways:

    • Option 1: Select a pre-defined "Optional Message Type" from the dropdown. You can either use this type as is, or edit the pre-populated fields. See the Service Message page for more details.

    • Option 2: Don't make an "Optional Message Type" selection; instead create a new one from scratch:

      1. Enter an "Input Title" for the service message.

      2. Configure the message schema:

        • Enter a "Field Name" for each parameter.
        • Select the data "Type" of each parameter.
        • Check the "Required" box for applicable parameters.
        • Click "+ Add Field" to add data fields.
        • Remove a parameter by clicking the delete icon to the right of the row.
        • Copy a parameter by clicking the copy icon to the right of the row.
  4. Click Next.

  5. Configure the output service following the same steps you used to configure the input service.

  6. Click Add Service.

Results:

  • The Service pair is added to Inputs and Outputs panels.
  • Click a service to view configuration details in the Properties panel.

Connect Inputs and Outputs to Skills

Message flows are created when you connect input sources to Skill actions and Skill action output data to other Skill actions as inputs.

Remove Inputs and Outputs from Agents

You can delete message paths, inputs, and outputs by clicking on the line to select it and then clicking "Delete" on your keyboard.

Test agent services

A service's endpoint is made available at a URL that is for a specific deployed instance of your Agent. You can deploy multiple instances of an Agent, which means you can test new versions of your Agent definition as you create them.

You can also run tests on your current working version of the Agent.

Additional details can be found in Test Agents.

Next Steps