Skip to main content

AI-powered reasoning and response workflow

Workflow preview

Workflow preview
100%
AI-powered reasoning and response workflow preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

: This workflow is designed to handle user inputs via a webhook, process the inputs with the Google Gemini API (specifically the gemini 2.0 flash thinking exp 1219 model), and return a structured r...

Best for

  • AI automation workflows
  • AI Chatbot automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.respondtowebhook, n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mauricio Perera.

Original n8n.io source

1.1 Workflow description

Title
AI-powered reasoning and response workflow
Workflow name
AI-powered reasoning and response workflow
Overview:

This workflow is designed to handle user inputs via a webhook, process the inputs with the Google Gemini API (specifically the gemini-2.0-flash-thinking-exp-1219 model), and return a structured response to the user. The response includes three key elements: reasoning, the final answer, and citation URLs (if applicable). This workflow provides a robust solution for integrating AI reasoning into your processes.

This workflow can be utilized as a tool for AI-based agents, intelligent email drafting systems, or as a standalone intelligent automation solution.


Setup:
  1. Webhook Configuration:

    • Ensure the webhook node is properly set up to accept GET requests with an input parameter.
    • Verify that the webhook path matches your application requirements.
    • Test the webhook using tools like Postman to ensure proper data formatting.
  2. Google Gemini API Credentials:

    • Set up your Google Gemini API account credentials in the HTTP Request node.
    • Ensure API access and permissions are valid.
  3. Parameter Adjustments:

    • Customize the temperature, topK, topP, and maxOutputTokens parameters to fit your use case.

Customization:
  1. Input Parameters:

    • Modify the webhook path or parameters based on the data your application will send.
  2. Response Formatting:

    • Adjust the JavaScript code in the "Process API Response" node to fit your desired output structure.
  3. Output Expectations:

    • Test the response returned by the "Return Response to User" node to ensure it meets your application requirements.

Workflow Steps:
  1. Receive User Input:

    • Node Type: Webhook
    • Purpose: Captures a GET request containing a user-provided input parameter. Acts as the starting point for the workflow.
  2. Send Request to Google Gemini:

    • Node Type: HTTP Request
    • Purpose: Sends the received input to the Gemini-2.0-flash-thinking-exp-1219 model for processing. The API configuration includes parameters for customizing the response.
  3. Process API Response:

    • Node Type: Code Node
    • Purpose: Extracts reasoning, the final answer, and citation URLs from the API response. Organizes the output for further use.
  4. Return Response to User:

    • Node Type: Respond to Webhook
    • Purpose: Sends the processed and structured response back to the user via the webhook. Ensures the response format meets expectations.

Expected Outcomes:
  • Input Handling: Successfully captures user input via a webhook.
  • AI Processing: Generates a structured response using the Gemini-2.0-flash-thinking-exp-1219 model, including reasoning, answers, and citations (if available).
  • Output Delivery: Returns a user-friendly response formatted to your specifications.

Notes:
  • The workflow is inactive by default.
  • Each node is annotated with a Sticky Note to clarify its purpose.
  • Ensure all API credentials are correctly configured before execution.
  • Use this workflow to save time, improve accuracy, and automate repetitive tasks efficiently.

Tags:
  • Automation
  • Google Gemini
  • AI Agents
  • Intelligent Automation
  • Content Generation
  • Workflow Integration

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Send Request to Google Gemini

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - Return Response to User

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 3 - Receive User Input

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 4 - Process API Response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Sticky Note - Receive User Input

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note - Send Request to Google Gemini

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note - Process API Response

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note - Return Response to User

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow AI-powered reasoning and response workflow
Complexity intermediate
Nodes 8
Categories AI, AI Chatbot
Author Mauricio Perera
Published 29 Dec 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2680/2680.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI-powered reasoning and response workflow do?

: This workflow is designed to handle user inputs via a webhook, process the inputs with the Google Gemini API (specifically the gemini 2.0 flash thinking exp 1219 model), and return a structured r...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your AI, AI Chatbot use case.