5.2.1 Create a Prompt Template Definition

Prompt template definitions are reusable and structured natural language system instructions—such as those used for summarizers or planners—that guide the output of tasks within a workflow.

Create a prompt template definition, which represents a reusable, structured prompt that incorporates placeholders and variables, which allows for dynamic application within workflows. This ensures consistency, flexibility, and efficiency. The same prompt template definition can be reused and tailored to individual applications within various workflows. By allowing you to introduce placeholders and variables, prompt template definitions enable dynamic interaction and make it easy to adapt prompts to different scenarios and use cases.

To create a prompt template definition:
  1. Open the navigation menu and click Agentic AI.
  2. Click the Prompt Template tab.

    The Prompt Template Definitions list page opens. All the prompt templates that you have defined are displayed in a table.

  3. Click add a new building block.
    The New Prompt Definition dialog box appears.
  4. Enter the following information.
    • Name: Enter a unique and descriptive name to identify this prompt template definition in workflows. The name can be up to 128-characters long. Use only letters, numbers, underscores (_), and hyphens (-). Spaces and other special characters are not supported. You cannot change this name later.
    • Description: Optional. Enter a description for the prompt template definition.
    • Prompt Text: Create a reusable prompt template for AI-powered workflow execution. Use prompt templates in GenAI Tasks for single-prompt use cases, such as summarizing text or classifying input, and in the Agentic Planner to guide dynamic decision-making during workflow execution. Here's an example prompt template which retrieves the credit score and takes an appropriate action based on the credit score.

      You are an AI planner for a loan approval workflow. 
      Your goal is to decide the next tool to call based on the results of previous steps. 
      Follow the conditions below exactly.
      First step: Connect to sqlcl 'oracledb_mcp' using connect tool and change status of 
      Loan application with APPLICATION_ID=${workflowId} to UNDER_REVIEW. 
      UPDATE LOAN_APPLICATIONS SET APPLICATION_STATUS = 'UNDER_REVIEW' WHERE APPLICATION_ID = workflowId; 
      Then, if no tasks have been run, call the `document_verification_task`.
      
      Second step: After document verification: If `document_verification_task` failed, the process stops.
      Respond with a final status of 'FAILED'. If it succeeded, call the `compliance_agent` and `loan_processing_agent`
      in parallel. After compliance and processing:
          * If `compliance_agent` failed due to an 'AML_CHECK', call `notify_aml_check_failure_to_admin` 
      and `human_aml_verification` in parallel.
          * For any other failure, the process stops. Respond with a final status of 'FAILED'.
          * If all tasks succeed, the process is complete. Respond with a final status of 'SUCCESS'.
      
      Output Instructions: Your response must only be a JSON object describing the next action. It should specify the `status` and a list of `next_tools_to_call`. If the process is finished, the list should be empty.

      You can also add variables, in the format ${workflowId}, where workflowId is the name of the variable. At runtime the variables are replaced with actual values.

  5. Click Submit.
Your new definition appears in the list of available prompt template definitions. Use a prompt template definition to guide the behavior of AI agents within a workflow.