Invoke Flow services over HTTP

IBM webMethods Integration allows you to trigger the execution of a flow service from an external system. This option provides you with another way to trigger flow service executions from a software application, for example, a REST client, apart from manual and scheduled executions from 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.

How it Works

  1. Log in to your tenant and from the IBM webMethods Integration navigation bar, click Projects. Select a project and then click Flow services.

  2. Click the ellipsis icon available on a flow service and select Overview. The Overview page appears.

  3. On the Overview page, select the Enable Flow service to be invoked over HTTP option. Once the flow service is enabled to be started over HTTP, the HTTP request URL appears.

    Note: When you enable the Invoke Flow service 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.
  4. Click the Advanced details section to view the HTTP Method, sample JSON input, and the parameters that are required to invoke the flow service from an external system.

    Synchronous URL

    You can execute flow services synchronously using the Run URL:

    https://sub-domain.domain/integration/rest/external/integration/run/stagename/integrationname
    • run - Flow service executes and the response contains the pipeline data.
    • sub-domain is a domain that is part of the primary domain.
    • run - Flow service executes and the response contains the pipeline data.
    • Stagename is the name of the active stage.
    • Integrationname is the name of the Flow service.
      Note: Provide your username and password to run the Flow service from the external program, else you may encounter the 401 - Unauthorized User Error.

    Asynchronous URL

    You can execute flow services asynchronously using the submit URL:

    https://sub-domain.domain/integration/rest/external/integration/submit/stagename/integrationname

    submit - Flow service has been submitted for execution and the response contains a status indicating whether the flow service has been submitted for execution. When the request is submitted for execution using the submit option, the response contains a reference to the execution result identifier so that a new HTTP call can be made later to get the execution results.

    Application Status Codes for submit

    • 0 - SUCCESS: Successfully submitted the flow service for execution.

    • -1 - ERROR: Problem while submitting the flow service for execution.

    To get the execution results, construct the URL of the new HTTP call from the URI field available in the Response section.

    To construct the URL of the new HTTP call, add the response URI obtained from resultReference in the Response section to:

    https://sub-domain.domain.com

    Response URI format: https://sub-domain.domain/integration/rest/external/integration/execution/result?resultReference=765733-6a21-4b02-864f-e958f698373

    HTTP Status Codes

    • 200 - OK
    • 500 - Internal Server Error
    • 401 - Unauthorized User Error Note: You must provide your user name and password to execute the flow service from the external program, else you may encounter the 401-Unauthorized User Error. Further, if the query response HTTP status code is 404 - Not Found, it means that either the flow service is not yet run or the resultReference is not correct.
  5. Download the Postman app (Windows 64-bit) from https://www.postman.com/downloads, install the app, and then sign-in to Postman.
  6. On the Postman page, click Create a request.
  7. On the Postman app Request page, select POST. Then copy the Synchronous URL from the IBM webMethods Integration flow service Overview page and paste it in the Enter Request URL field.
  8. Go to the IBM webMethods Integration flow service Overview > Advanced details page and get the Content-Type and Accept header parameters.
  9. Go to the Postman app Request page, click Headers, and enter the Content-Type and Accept values .
  10. On the Postman app Request page, select POST, click Authorization, select the Type as Basic Auth, enter your IBM webMethods Integration login user name and password, and click Send.

    The result appears in the Body section at the lower part of the Postman Request page. The execution result also appears on the IBM webMethods Integration flow service Execution History page and on the Monitor > Execution Results > Flow service Execution page under Execution Logs.