BAMOE enables you to create Business Services that contain Workflows able to send prompts, that can query LLMs for generated textual-content as part of the business process.

Using the Gen AI Task you can seamlessly integrate Large Language Models (LLMs) into your process automation, enabling intelligent text processing, content generation and decision making within your workflow.

The Gen AI Task enables you to:

  • Integrate AI into Workflows by dragging a Gen AI task directly into your BPMN process models, in the same way as other task components.

  • Choose from various AI providers including:

  • Design and test AI prompts directly within your BAMOE Canvas or from BAMOE Developer Tools for VS Code to create your custom prompt that is tailored to your business needs.

  • Work with your existing process variables and data. The AI is used to make intelligent decisions or generate content based on real business information.

  • Test your AI prompts and preview results before deploying your process, ensuring the AI behavior meets your expectations.

In order to create and test the Gen AI task in BAMOE Canvas and BAMOE Developer Tools for VS Code you will need to connect and authenticate to one of the AI providers available in this integration: watsonx, Ollama or Open AI. An AI Provider is a service that offers access to AI models for tasks such as, text generation and answering questions.These providers typically offer pre-trained models, APIs, and software development kits (SDKs) to help developers integrate AI into their applications.

Connecting to an AI provider in BAMOE Canvas

To connect to an AI provider from BAMOE Canvas follow these steps:

  1. Navigate to Profile → Connect to an Account.

  2. From the list of available AI providers (WatsonX, Ollama, OpenAI), select the provider you wish to integrate.

    genai connect
    Figure 1. Selecting an AI provider
  3. Enter a Display Name (e.g., My XXX Account)

    genai authenticate watsonx
    Figure 2. Connecting to WatsonX
  4. Depending on the selected AI Provider enter the following information

    1. WatsonX - enter your AP Key, Project ID and Service URL (obtained from your WatsonX account)

    2. OpenAI - enter your API Key and Service URL (obtained from the OpenAI website)

    3. Ollama - enter your service URL (obtained as a result of launching the server)

  5. Click Connect

Connecting to an AI provider in BAMOE Developer Tools for VS Code

To connect to an AI provider from BAMOE Developer Tools for VS Code follow these steps:

  1. Navigate to the Profile menu in the bottom left corner.

  2. From the list of available AI providers (WatsonX, Ollama, OpenAI), select the provider you wish to integrate.

    genai connect vscode
    Figure 3. Selecting an AI provider
  3. For more information on the different fields to complete to connect to each AI provider see Connecting with Canvas

Creating a Gen AI task in your workflow

To create a Gen AI task in your workflow follow this process:

  1. Click the Custom Task icon at the bottom of the left pane.

  2. From the dialog that is displayed click and drag a Gen AI Task from the palette.

    genai task create
    Figure 4. Creating a Gen AI Task
  3. Once the Gen AI Task is created you can connect it to other nodes in the BPMN workflow and select and edit its properties in the usual way.

    genai task props
    Figure 5. Gen AI Task Properties Panel

Input and Output Data Mapping

Input and output data mappings are defined though the Properties panel as for other task types.

genai data mapping
Figure 6. Gen AI Task Data Mapping

Configure which process variables to send to the AI, and set up where the AI’s response should be stored in your process.

Note
The input variables mapped in this dialog can be referenced later in the prompt input.

Create your Prompt

In your Gen AI Task Properties panel:

  1. Select the AI Provider you want to use. If you haven’t configured a connection to this provider you will not be able to test it in the editor (see Connect to an AI Provider).

  2. Select a model from the list provided by the selected AI Provider, or type the model name if you haven’t yet connected to an AI Provider. An AI model is a trained system that processes input and generates responses based on patterns it has learned from data.

    genai model select
    Figure 7. Gen AI task model
    1. If the model you require is not available you may need to install it and enter the model name manually.

  3. You can adjust the Temperature hyperparameter (a decimal between 0 and 2) to adjust how creative or predictable the model responses are.

    1. A lower temperature (e.g., 0.2) results in more predictable and conservative responses.

    2. A higher temperature (e.g., 1.5) results in more creative and varied responses.

  4. Set the Token Limit to determine the maximum number of tokens (unit of text - word or character) that the model can generate in a single response.

    1. Increasing the token limit will enable longer and more detailed responses, but may increase the computational cost and latency of the model.

    2. The maximum tokens allowed may vary according to your plan with the AI Provider or the model selected.

  5. Craft your prompt in the Prompt field following the usual guidelines to ensure an effective prompt. The prompt you enter is prefixed by the default System prompt configured by the Gen AI Task WorkItemHandler and which instructs the LLM to perform variable interpolation and is aligned with IBM’s prompt injection prevention guidelines (https://www.ibm.com/think/insights/prevent-prompt-injection).

    1. You can make a prompt dynamic by using Process Variables. To reference a variable include the variable name in double nested curly brackets, e.g., {{<myVariableName}}. The editor will highlight these variables in blue, and supports auto-suggest functionality. If you type '{{}}' with your cursor between the brackets, and press Ctrl + Space, a dropdown list displays the Data Input Mapping variables you have already set up.

      genai prompt
      Figure 8. Prompt with Process variable auto-suggest
  6. Using the Preview feature you can test the results of your prompt, using the Preview Table to provide temporary values for data input variables.

    genai example task config
    Figure 9. Testing a Prompt

    Which displays the following result:

    genai example prompt result
    Figure 10. Testing a Prompt
  7. Depending on the result you may want to adjust your prompt.

This completes the process to create a Gen AI Task in your Workflow.

Configuring a Business Service that contains a Gen AI task

In a Business Service containing stateful Workflows that include a Gen AI task, you will need to configure evironment variables in the application.properties file, to enable connection to an AI provider at runtime.

The following example shows the default properties to enable a connection to IBM Watsonx, the user should provide their AI provider credentials, such as API keys and project IDs. By default log-request and log-responses are set to false.

bamoe.workflow.gen-ai-task.provider.watsonx.base-url=https://us-south.ml.cloud.ibm.com
bamoe.workflow.gen-ai-task.provider.watsonx.api-key=<api-key>
bamoe.workflow.gen-ai-task.provider.watsonx.project-id=<project-id>
bamoe.workflow.gen-ai-task.provider.watsonx.log-requests=<false | true>
bamoe.workflow.gen-ai-task.provider.watsonx.log-responses=<false | true>

For OpenAI, the API key is required:

bamoe.workflow.gen-ai-task.provider.openai.base-url=https://api.openai.com/v1/
bamoe.workflow.gen-ai-task.provider.openai.api-key=<api-key>
bamoe.workflow.gen-ai-task.provider.openai.log-requests=<false | true>
bamoe.workflow.gen-ai-task.provider.openai.log-responses=<false | true>

For OLLAMA, only the base URL is needed:

bamoe.workflow.gen-ai-task.provider.ollama.base-url=http://localhost:11434
bamoe.workflow.gen-ai-task.provider.ollama.log-requests=<false | true>
bamoe.workflow.gen-ai-task.provider.ollama.log-responses=<false | true>

In addition there is a configuration that enables you to override the default System message prompt: bamoe.workflow.gen-ai-task.system-message. You can use this property to set a string value that replaces the default System message.

Installing and configuring Ollama

Ollama is a lightweight runtime for running large language models locally. You can install it and configure its API server with custom networking options, such as binding to a specific host or enabling CORS for browser clients.

  1. Download and install from the official Ollama Download Page

  2. Verify Installation by checking that the ollama CLI is available:

    ollama --version
  3. Start Ollama with Host and CORS Options.

    By default, Ollama only listens on localhost:11434. You can override this using environment variables:

    • OLLAMA_HOST → Define which host/port the API should bind to

    • OLLAMA_ORIGINS → Define allowed CORS origins (comma-separated)

  4. Bind to all interfaces and allow requests from BAMOE Canvas

    OLLAMA_HOST=0.0.0.0:11434 OLLAMA_ORIGINS=<bamoe-canvas-url> ollama serve

    This ensures that:

    • Ollama is accessible on all network interfaces (not just localhost).

    • Enable CORS for the allowed frontend origins (in this case BAMOE Canvas).

      Setting OLLAMA_ORIGINS="*" will allow any origin. More information in the Ollama FAQ page.

  5. Pull models using ollama pull <model_id>

    The available models can be found in the Ollama library.