Skip to main content

Command Palette

Search for a command to run...

n8n with Azure Open AI : expand your workflow !

Updated
3 min read
n8n with Azure Open AI : expand your workflow !

Today, we’ll look at two complementary aspects to enhance your workflows and APIs interactions: first, n8n, a platform for workflow automation, and Azure OpenAI, which enables the creation and management of AI resources.

What is n8n and how to install it?

N8n is a workflow automation tool that lets you schedule tasks and connect different applications, platforms, and services. n8n can be used as Saas but has also a free version that can be used on your own infra. In this example, we’ll install it on our own server (with traefik as reverse proxy) with a docker-compose file :

services:

  traefik:
    image: traefik:v3.0
    restart: always
    command:
      - "--log.level=DEBUG"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:8080"
      - "--entrypoints.websecure.address=:443"
    ports:
      - "8080:8080"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./certs:/certs
    networks:
      - traefik-net

  n8n:
    image: docker.n8n.io/n8nio/n8n:1.82.1
    restart: always
    user: "1000:1000"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=PathPrefix(`/`)
      - traefik.http.routers.n8n.entrypoints=websecure
      - traefik.http.routers.n8n.tls=true
      - traefik.http.services.n8n.loadbalancer.server.port=5678
    environment:
      - N8N_HOST=your_IP
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://your_ip_address/
      - GENERIC_TIMEZONE=Europe/Paris
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=XXXXXXXXXXXXXXXX
      - N8N_SECURE_COOKIE=true
    volumes:
      - ./n8n_data:/home/node/.n8n
    networks:
      - traefik-net

n8n – Workflow Automation Made Simple

With its visual editor, you can design workflows by assembling nodes, each representing an action such as calling an API, transforming data, or triggering another service.

There’re some concurrents, for example Zapier that uses the same principe; but n8n can be self-hosted (for exemple using the docker image), in addition to the SaaS version.

To begin our first workflow configuration, let’s take the case of retrieving email attachments

The principle is straightforward: each block (or node) represents an action, such as connecting to the Microsoft Graph API to fetch emails and attachments. Nodes are then linked together, passing inputs and outputs to each other. For instance, an attachment retrieved from an email can be sent to another service to be reformatted before being stored in a different application.

Because n8n is a no-code workflow automation platform, all nodes are configured visually. This makes it possible to build complex workflows without writing custom code.

To help you, there’re tons of integrations and examples here : https://n8n.io/integrations/

Adding AI into the Workflow

Now let’s extend this workflow with an AI component. By integrating Azure OpenAI into n8n, AI becomes just another node in the chain. Since Azure OpenAI provides an API endpoint, you can send information to an AI agent and use its response to enrich or transform your workflow.

In our example, we’ll connect to an AI agent configured in the Azure portal and managed through Azure AI Foundry.

Azure AI Foundry allows you to:

  • Manage API keys and model selection

  • Compare performance across multiple AI models (screenshot here)

  • Build and customize your own AI agents

  • Index and query documents

  • Integrate connectors such as SharePoint, Azure Blob Storage, SQL databases, and more

  • Control access and monitoring through RBAC and Azure Monitor

When adding an OpenAI node in n8n, you can define the behavior of the agent directly in the node configuration, and adjust it as needed (response format, retries, model, prompt, etc)

Workspace integration with “LLM” and “Azure OpenAI” nodes.

Conclusion

By combining n8n with a custom AI agent hosted in Azure OpenAI, you can design workflows that go far beyond basic task automation. This approach lets you build processes to your exact needs, offload repetitive work, and make your workflows smarter and more efficient!

More from this blog

D

DINA DevOps Technical's Blog

59 posts