A Joget Workflow plugin that integrates Google Gemini AI for intelligent content generation and processing within your workflows.
This plugin allows you to send user prompts to Google's Gemini AI API and store the AI-generated responses in workflow variables. It's perfect for automating content generation, analysis, and intelligent decision-making within your business processes.
- π€ Google Gemini AI Integration - Supports multiple Gemini models (1.5 Flash, 1.5 Pro, 2.0 Flash, 2.0 Pro)
- π Flexible Prompt Handling - Use workflow variables or custom templates for prompts
- π§ Configurable System Instructions - Customize AI behavior and expertise domain
- π Additional Context - Include multiple workflow variables as context
- π Secure API Key Management - Encrypted storage of your Gemini API key
- π Debug Logging - Comprehensive logging for troubleshooting
- β‘ Easy Integration - Simple drag-and-drop into your workflow processes
- Joget Workflow v7+
- Google Cloud Account with Gemini API access
- Valid Gemini API Key
-
Build the plugin:
mvn clean compile package
-
The compiled JAR file will be available at:
target/gemini-ai-process-tool-1.0.0.jar -
Upload the JAR file to your Joget instance via Settings > System Settings > Manage Plugins
CRITICAL REQUIREMENT: All input values (like userprompt) must be properly stored in Joget's workflow variables and process variables before using this plugin.
-
Form Fields: Configure your form fields to store data in workflow variables
- In Form Builder, set the ID of form elements to match your variable names
- Example: Text field with ID
userpromptwill store data in workflow variableuserprompt
-
Process Variables: Ensure variables are available at the process level
- Variables must be accessible throughout the workflow process
- Use form fields, previous process tools, or manual variable assignment
-
Variable Naming: Use simple names without special characters
- β
Good:
userprompt,customerName,orderAmount - β Avoid:
user-prompt,customer.name,order_amount
- β
Good:
Step 1: Form with fields
βββ Text Area (ID: userprompt) β stores in workflow variable "userprompt"
βββ Text Field (ID: customerName) β stores in workflow variable "customerName"
βββ Number Field (ID: orderAmount) β stores in workflow variable "orderAmount"
Step 2: Gemini AI Process Tool
βββ User Prompt Variable: userprompt
βββ Additional Context Variables: customerName,orderAmount
βββ Output Variable Name: aiResponse
Step 3: Display Results
βββ Text Area displaying #{variable.aiResponse}
| Field | Description | Default |
|---|---|---|
| Gemini API Key | Your Google Gemini API key (required) | - |
| AI Model | Choose from available Gemini models | gemini-1.5-flash |
| Field | Description | Default | Requirements |
|---|---|---|---|
| User Prompt Variable | Workflow variable containing the user prompt | userprompt |
Must exist in workflow variables |
| Additional Context Variables | Comma-separated list of variables to include | - | Each variable must exist in workflow variables |
| Custom Prompt Template | Custom template using #{variable.name} syntax |
- | Referenced variables must exist in workflow |
| Field | Description | Default |
|---|---|---|
| Output Variable Name | Variable to store the AI response | aiResponse |
| System Instruction | Instructions to guide AI behavior | You are a helpful and concise AI assistant. |
- Create a form with a text area field having ID
userprompt - Ensure the form properly stores data in workflow variables
- Add the Gemini AI Process Tool to your workflow after the form
- Configure the plugin with your API key
- The AI response will be stored in
aiResponseworkflow variable
Prerequisites:
- Form field with ID: userQuestion (stores in workflow variable "userQuestion")
- Form field with ID: customerName (stores in workflow variable "customerName")
- Form field with ID: orderAmount (stores in workflow variable "orderAmount")
- Form field with ID: productType (stores in workflow variable "productType")
Plugin Configuration:
User Prompt Variable: userQuestion
Additional Context Variables: customerName,orderAmount,productType
Custom Prompt Template:
Analyze this customer request: #{variable.userQuestion}
Customer Details:
- Name: #{variable.customerName}
- Order Amount: #{variable.orderAmount}
- Product Type: #{variable.productType}
Provide recommendations based on this context.
Before using the plugin, verify:
- β All input variables exist in your workflow
- β Form fields have correct IDs matching variable names
- β Variables contain actual data (not empty)
- β Variable names don't include # symbols in plugin configuration
- β Process flow allows variables to be set before AI tool execution
| Model | Description | Best For |
|---|---|---|
gemini-1.5-flash |
Fast responses, good quality | Quick processing, real-time applications |
gemini-1.5-pro |
Advanced reasoning | Complex analysis, detailed responses |
gemini-2.0-flash |
Latest fast model | Enhanced speed with improved quality |
gemini-2.0-pro |
Latest advanced model | Most sophisticated analysis and reasoning |
The plugin reads from workflow variables you specify:
- Primary prompt from
User Prompt Variable - Additional context from
Additional Context Variables - Custom formatting via
Custom Prompt Template
The AI response is automatically stored in the specified Output Variable Name and can be used in:
- Subsequent workflow activities
- Form fields using
#{variable.aiResponse} - Decision nodes for conditional logic
- Email notifications and reports
The plugin includes comprehensive error handling:
- Missing API Key: Clear error message with configuration guidance
- Network Issues: Timeout handling with retry logic
- Invalid Responses: JSON parsing error handling
- Variable Issues: Graceful handling of missing workflow variables
Enable debug logging by adding a .env file in src/main/resources/:
DEBUG=true
Debug logs include:
- Configuration validation
- API request/response details
- Variable processing information
- Error diagnostics
- API keys are stored securely using Joget's encrypted password field type
- Network requests use HTTPS encryption
- No sensitive data is logged in production mode
"API Key is required" error
- Ensure your Gemini API key is properly configured in the plugin settings
- Verify the API key is valid and has Gemini API access enabled
"No valid prompt could be constructed" error
- Check that your
User Prompt Variablecontains data - Verify variable names don't include
#symbols in configuration - Ensure the specified workflow variables exist
Empty AI responses
- Check your API key has sufficient quota
- Verify the Gemini model you selected is available
- Review debug logs for API error details
Output variable not populated
- Confirm the
Output Variable Nameis correctly specified - Check that subsequent activities can access the variable
- Verify workflow variable scope and timing
For issues and questions:
- Enable debug mode and check logs
- Verify your Gemini API key and quota
- Test with simple prompts first
- Review Joget workflow variable configuration
- v1.0.0 - Initial release with Google Gemini AI integration
This plugin is developed for use with Joget Workflow platform.