Invoking flow services over HTTP

Use HTTP-based invocation to trigger flow services through web requests from external systems or applications.

About this task

Flow service execution can be triggered from an external system, such as a REST client. This provides an alternative to manual or scheduled execution through the user interface.

On the external program, provide the HTTP URL, Method, required JSON body, and necessary header parameters, including the required security credentials (username and password) to start the flow service. After the flow service is run, the response contains the pipeline data.

Important: Your services must respond within 10 minutes to external client invocations. If processing does not complete within this limit, the request is automatically terminated and a timeout error is returned to the calling application.​‌

If you expect a process to run longer than 10 minutes, use an asynchronous messaging pattern instead of a synchronous request-response invocation. Messaging decouples the client from the long-running process, allows work to continue in the background while preventing timeout-related failures and improving reliability and scalability. For more information, see Messaging.

Procedure

  1. Click Projects. Select a project and then click Integrations > Flow services.
  2. On the Overview page, select the Enable Flow service invocation over HTTP option. After you enable the flow service to start over HTTP, the HTTP request URL appears.
    Note: When you enable the Enable Flow service invocation over HTTP option for a flow service, and clone, export, or import it, the option stays enabled in the cloned, exported, or imported flow service.
  3. Click the Advanced details section to view the parameters that include the API key such as X-INSTANCE-API-KEY that are required to start the flow service from an external system.
    • You can run flow services synchronously by using the run URL.

      .../integration/rest/external/integration/run/development/integrationname

      Note: Provide an API Key or Service ID to run the flow service from the external program, else you can encounter the 401 - Unauthorized User Error.

      For detailed steps on how to create API keys and Service IDs in the SaaS Console, see Granting access through service IDs and API keys from the IBM SaaS console.

  4. Download a REST client, install the app, and then sign-in to the app.
  5. On the REST client, click Create a request.
  6. On the Request page, select POST. Then copy the URL from the webMethods Integration flow service Overview page and paste it in the Enter Request URL field.
  7. Go to the REST client app. On the request page, click Headers, and enter the Content-Type and Accept values.
  8. Select POST.
  9. Click Authorization, select the Type as API Key.
  10. In the Key field, enter the key name as is displayed in the webMethods Integration flow service Overview > Advanced details page.
  11. In the Value field, provide the API key value that is generated by using the SaaS Console for authentication.
  12. In the Add to field, select Header from the list.
  13. Click Send.
  14. The result appears in the Body section of the REST client request page. The execution result also appears on the webMethods Integration flow service Execution History page. In addition, you can view the results on the Monitor > Execution Results > Flow service Execution page in the Execution Logs.