Skip to main content
Starting from version 2.11.0, connections are automatically assigned to custom agents during import when you declare them in your agent.yaml configuration file.Declare connection requirements in the connections section of your agent.yaml file. The system uses a dictionary structure where:
  • Keys are either "global_requirements" (for agent-wide requirements) or tool function names (for tool-specific requirements)
  • Values are connection requirement specifications
Each connection requirement block supports two fields:required_app_ids — All listed connections must be present and configured for the agent to run. required_one_of — A list of groups, where at least one connection from each group must be present and configured. Use this when your agent supports multiple alternative providers (for example, different LLM APIs).You can use either or both fields in the same connection requirement block.Example:

How required_one_of works

required_one_of takes a list of groups. Each group is itself a list of app IDs. The agent requires at least one app ID from each group to be configured, groups are independent of each other. If no connection in a required group is configured when the agent is invoked, the agent returns an error.A group can be written in two equivalent YAML styles:Flow style (inline):
YAML
Block style (expanded):
YAML
Both are equivalent. Use whichever is more readable for your use case.Flow style (inline):When you import an agent with connections defined in agent.yaml:
  • Existing Configured Connections: If a connection with the specified app_id already exists and is configured, the system automatically assigns it to your agent.
  • Non-existent Connections: If a connection with the specified app_id doesn’t exist, the system automatically creates it during import. However, you need to configure it later using the orchestrate connections configure command. For more information, see Manual Connection.
  • Non-existent required_one_of Connections: The system only creates connections for required_one_of app IDs that already exist. Alternatives that are not yet registered are not auto-created.
  • Duplication: If multiple tools require the same connection, it appears only once in error messages.

Connection Credential Format

watsonx Orchestrate uses your connection to set custom agent credentials. It injects your credential key at runtime. It follows the format:
Where:
  • connection_app_id is the unique ID of your connection app.
  • credential_type is the value you set with the -k parameter when you configure the connection.
Example:
BASH
Your credential key becomes:
For more details on creating and configuring connections, see Creating connections.