Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 36 additions & 27 deletions nodejs/n8n/sample-agent/Agent-Code-Walkthrough.MD
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,42 @@ sample-agent/
└─────────────────────────────────────────────────────────────────┘
```

## 🔍 Configuration Requirements

### Configure n8n webhook

- Create a workflow in n8n with a webhook trigger
- Configure the webhook to accept POST requests
- The webhook should expect a JSON body with `text`, `from`, `type`, and optional `mcpServers` fields
- Return a JSON response with an `output` field containing the response text

### Required Environment Variables
```bash
# Agent Identity
AGENT_ID=your-agent-id
AGENTIC_USER_ID=your-user-id

# n8n Integration
N8N_WEBHOOK_URL=https://your-n8n-instance/webhook/path
N8N_WEBHOOK_AUTH_HEADER="Basic base64credentials"

# Service Connection (Authentication)
connections__service_connection__settings__clientId=<client-id>
connections__service_connection__settings__clientSecret=<client-secret>
connections__service_connection__settings__tenantId=<tenant-id>

# Agentic Authentication
agentic_type=agentic
agentic_altBlueprintConnectionName=service_connection
agentic_scopes=ea9ffc3e-8a23-4a7d-836d-234d7c7565c1/.default

# MCP Tools (Optional)
MCP_AUTH_TOKEN=optional-bearer-token
TOOLS_MODE=MCPPlatform
```

---

## 🔍 Core Components Deep Dive

### Code Overview
Expand Down Expand Up @@ -193,33 +229,6 @@ interface N8nResponse {
// Handle actions, show adaptive cards, etc.
```

## 🔍 Configuration Requirements

### Required Environment Variables
```bash
# Agent Identity
AGENT_ID=your-agent-id
AGENTIC_USER_ID=your-user-id

# n8n Integration
N8N_WEBHOOK_URL=https://your-n8n-instance/webhook/path
N8N_WEBHOOK_AUTH_HEADER="Basic base64credentials"

# Service Connection (Authentication)
connections__service_connection__settings__clientId=<client-id>
connections__service_connection__settings__clientSecret=<client-secret>
connections__service_connection__settings__tenantId=<tenant-id>

# Agentic Authentication
agentic_type=agentic
agentic_altBlueprintConnectionName=service_connection
agentic_scopes=ea9ffc3e-8a23-4a7d-836d-234d7c7565c1/.default

# MCP Tools (Optional)
MCP_AUTH_TOKEN=optional-bearer-token
TOOLS_MODE=MCPPlatform
```

---

## **Summary**
Expand Down
5 changes: 5 additions & 0 deletions nodejs/n8n/sample-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ To set up and test this agent, refer to the [Configure Agent Testing](https://le

For a detailed explanation of the agent code and implementation, see the [Agent Code Walkthrough](Agent-Code-Walkthrough.MD).

## Deploying the Agent

Refer to the [Deploy and publish agents](https://learn.microsoft.com/en-us/microsoft-agent-365/developer/publish-deploy-agent?tabs=nodejs) guide for complete instructions.


## Support

For issues, questions, or feedback:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "461a6493-2950-4c11-9d77-ca3df5e6c2af",
"schemaVersion": "0.1.0-preview",
"agentIdentityBlueprintId": "57d51d64-8ec9-40ce-8b38-337332a013f8",
Comment thread
rbrighenti marked this conversation as resolved.
"communicationProtocol": "activityProtocol"
}
Binary file added nodejs/n8n/sample-agent/manifest/color.png
Comment thread
rbrighenti marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions nodejs/n8n/sample-agent/manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
"id": "50d46822-0bfb-4492-9b2b-114fcbf601dd",
"name": {
"short": "n8n Sample Agent",
"full": "n8n Sample Agent"
},
"description":
{
"short": "n8n Sample Agent",
"full": "This sample demonstrates how to build an agent using n8n in Node.js with the Microsoft Agent 365 SDK."
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#07687d",
"version": "1.0.0",
"manifestVersion": "devPreview",
"developer":
{
"name": "Agent Developer",
"mpnId": "",
"websiteUrl": "https://go.microsoft.com/fwlink/?LinkId=518028",
"privacyUrl": "https://go.microsoft.com/fwlink/?LinkId=518028",
"termsOfUseUrl": "https://shares.datatransfer.microsoft.com/assets/Microsoft_Terms_of_Use.html"
},
"agenticUserTemplates" :
Comment thread
rbrighenti marked this conversation as resolved.
[
{
"id": "461a6493-2950-4c11-9d77-ca3df5e6c2af",
"file": "agenticUserTemplateManifest.json"
}
]
}
Binary file added nodejs/n8n/sample-agent/manifest/outline.png
Comment thread
rbrighenti marked this conversation as resolved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading