Skip to content
flowon.com

Logic Composer

Service connections

Connect logic flows to external REST APIs by describing them with an OpenAPI specification and their security.

A service connection describes an external REST API once, so that any logic flow in your solution can call it. You give the connection the API’s address, its OpenAPI specification and the credentials it needs. Flows then pick an operation from the specification in the Call Rest Api step, and never handle URLs or secrets themselves.

  • Get the API’s OpenAPI 3.0 or 3.1 specification, in JSON or YAML. Swagger 2.0 (OpenAPI 2.0) is not supported; convert it to OpenAPI 3 first.
  • Find out how the API authenticates, and check that the method is supported.
  1. Go to Logic FabricSettingsService Connections and select New.
  2. Enter a Name and choose the Project. The Type is Rest. All three are locked after the first save.
  3. On the API tab, add the specification in OpenAPI Specification: paste it, select Load file (.json, .yaml or .yml), or select Load from URL and enter the Address of the OpenAPI specification.
  4. Enter the URL that requests go to. If it differs from the server named in the specification, you can select Use the specification’s server.
  5. Check the summary under the editor: the API title, version and the list of operations.
  6. On the Security tab, configure each security scheme the specification declares.
  7. Save the form.

A connection can be saved without any security scheme; its calls are then sent without authentication. A call is also sent unauthenticated when none of the connection’s schemes matches the operation, so check the Security Scheme chosen on each Call Rest Api step.

Select Expand to let the editor fill the whole browser window; select Collapse or press Esc to return.

The API tab holds the address and the specification.

Setting What it does Notes
URL “Requests go to this address followed by the operation’s path.” When it is not the server the specification names, a warning says “Calls go to the URL.”
OpenAPI Specification The API description, edited as code with line numbers JSON or YAML. Format pretty-prints JSON.
Load file Loads a .json, .yaml or .yml file
Load from URL Downloads the specification from an https:// address Loaded JSON is formatted; YAML is kept as served

Load from URL fetches the specification from your browser. If it fails:

  • “Enter a full address that starts with https://.” Only https:// addresses are accepted.
  • “The site answered with status …” Check the address and try again.
  • “The specification couldn’t be loaded from this address. The site may not allow loading it from the browser…” Many APIs do not allow this. Download the file and use Load file instead.

The specification is checked as you type:

  • A good one shows “Valid OpenAPI 3.x specification · n operations”.
  • A broken one shows the line and the problem (“Line 12: …”) and “Fix the specification to save the connection.” You cannot save until it is fixed.
  • OpenAPI 2.0 is refused: “OpenAPI version 2.0 is not supported. Use OpenAPI 3.0 or 3.1.”

Below the editor, the summary shows the API title (“Untitled API” if it has none), its version and every operation with its method, path, operation id (“No operation id” if missing), and the full address it Calls. If the specification has no operations, the summary warns that “flows have nothing to call”.

YAML specifications are kept exactly as you wrote them. Specifications without a components section are supported.

The Security tab lists the schemes under Declared in the specification, each with a status:

Status Meaning
Configured The scheme has credentials and calls can use it
Not configured Add credentials for it. The tab shows how many are missing (“2 missing”).
Not supported by connections The specification uses an authentication method that connections cannot use

Select Add next to a declared scheme to create it with its name, type, key and location already filled in from the specification. Then complete the credentials in the Add Security Scheme panel:

Type Fields
Basic Username, Password
Api Key Key (the header, query parameter or cookie name), Value, Location: Header, Query or Cookie
OAuth 2.0 Flow Type, Client Id, Client Secret, Scope, Credentials Location (“Send as Basic Auth header” or “Send client credentials in body”), Access Token Url. Authorization Code also shows Auth Url, Callback URL and State Auth.
Method Works in calls today
API key in a header, query parameter or cookie Yes
HTTP Basic Yes
OAuth 2.0 Client Credentials Yes
OAuth 2.0 Password Credentials Yes
OAuth 2.0 Authorization Code No. You can enter it, but calls that use it fail.
OAuth 2.0 Implicit No. You can enter it, but calls that use it fail.
HTTP schemes other than Basic, such as bearer tokens No: “Not supported by connections”
OpenID Connect No: “Not supported by connections”

Add the Call Rest Api step to a logic flow and choose the Service Connection and the Operation. The step shows one input per operation parameter, a Request branch to build the body, one Response branch per status code in the specification, and an Unexpected Error branch for failed calls. If the connection has more than one security scheme, choose the Security Scheme to use. See integration steps.

  • Calls go to the URL followed by the operation’s path, even when the specification names another server.
  • A service connection that a flow uses cannot be deleted (“Service connection entry is in use. Remove all dependencies before deleting.”).
  • Service connections differ per environment: the test system’s URL and credentials are not the production ones. The CLI’s data map files let you set the connection for each environment when you deploy. See Data mapping.
  • In a project whose solution is managed, the connection opens read-only.

A company keeps customer master data in its ERP, which publishes an OpenAPI 3.0 specification at https://erp.contoso.com/openapi.json and authenticates with OAuth 2.0 Client Credentials.

  1. Create the connection Contoso ERP and load the specification with Load from URL. The summary lists operations such as GET /customers/{id} and POST /customers.
  2. Set the URL to the test ERP, https://erp-test.contoso.com/api.
  3. On Security, select Add next to the declared oauth scheme, choose Client Credentials, and enter the Client Id, Client Secret, Scope and Access Token Url that the ERP team provides.
  4. In the flow Sync account to ERP, add Call Rest Api with the createCustomer operation. In the Response branch for 201, store the ERP customer number on the account. In Unexpected Error, create a “Sync Error” record.
  5. When deploying to production, set the production URL and credentials through the data map files.