diff --git a/nodejs/n8n/sample-agent/Agent-Code-Walkthrough.MD b/nodejs/n8n/sample-agent/Agent-Code-Walkthrough.MD index e3620a33..ffe8c200 100644 --- a/nodejs/n8n/sample-agent/Agent-Code-Walkthrough.MD +++ b/nodejs/n8n/sample-agent/Agent-Code-Walkthrough.MD @@ -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= +connections__service_connection__settings__clientSecret= +connections__service_connection__settings__tenantId= + +# 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 @@ -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= -connections__service_connection__settings__clientSecret= -connections__service_connection__settings__tenantId= - -# 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** diff --git a/nodejs/n8n/sample-agent/README.md b/nodejs/n8n/sample-agent/README.md index 12c64acd..d9b3f615 100644 --- a/nodejs/n8n/sample-agent/README.md +++ b/nodejs/n8n/sample-agent/README.md @@ -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: diff --git a/nodejs/n8n/sample-agent/manifest/agenticUserTemplateManifest.json b/nodejs/n8n/sample-agent/manifest/agenticUserTemplateManifest.json new file mode 100644 index 00000000..c404b6cc --- /dev/null +++ b/nodejs/n8n/sample-agent/manifest/agenticUserTemplateManifest.json @@ -0,0 +1,6 @@ +{ + "id": "461a6493-2950-4c11-9d77-ca3df5e6c2af", + "schemaVersion": "0.1.0-preview", + "agentIdentityBlueprintId": "57d51d64-8ec9-40ce-8b38-337332a013f8", + "communicationProtocol": "activityProtocol" +} \ No newline at end of file diff --git a/nodejs/n8n/sample-agent/manifest/color.png b/nodejs/n8n/sample-agent/manifest/color.png new file mode 100644 index 00000000..760f6d54 Binary files /dev/null and b/nodejs/n8n/sample-agent/manifest/color.png differ diff --git a/nodejs/n8n/sample-agent/manifest/manifest.json b/nodejs/n8n/sample-agent/manifest/manifest.json new file mode 100644 index 00000000..ce8a3828 --- /dev/null +++ b/nodejs/n8n/sample-agent/manifest/manifest.json @@ -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" : + [ + { + "id": "461a6493-2950-4c11-9d77-ca3df5e6c2af", + "file": "agenticUserTemplateManifest.json" + } + ] +} \ No newline at end of file diff --git a/nodejs/n8n/sample-agent/manifest/outline.png b/nodejs/n8n/sample-agent/manifest/outline.png new file mode 100644 index 00000000..8962a030 Binary files /dev/null and b/nodejs/n8n/sample-agent/manifest/outline.png differ