Repository navigation
Integration Templates
Step-by-step guides for integrating XRCopilot Agent Tasks with Power Automate, SharePoint, and Azure Logic Apps.
Prerequisites: an Agent Task configured with a Webhook trigger, the generated API key, and the APIM subscription key. See Webhooks-Agent-Tasks for the full technical details. To invoke external HTTP endpoints from inside an orchestrator workflow, see Webhooks-Connections-Action-Steps.
- Required Credentials
- Power Automate
- SharePoint
- Azure Logic Apps
- Receiving Results (Outbound Webhook)
- Troubleshooting
All integrations require these credentials:
| Credential | Where to find it | Where to configure it |
|---|---|---|
| APIM Subscription Key | Provided by your XRCopilot administrator |
Ocp-Apim-Subscription-Key header |
| Webhook API Key | Generated when the webhook is created (shown only once) |
X-Api-Key header |
| Hook ID | Visible in the webhook configuration (format wh_...) |
URL path |
Base URL:
https://apim-hipexr-prod-italynorth.azure-api.net/api/lab-public/hooks/{hookId}
Security: Store credentials in Azure Key Vault or in the environment variables of the flow/logic app. Do not embed them directly in the flow code.
A manually triggered flow that invokes an AI agent and sends the results via email.
When to use it: On-demand reports, ad hoc analysis, Q&A with the agent.
- Power Automate > My flows > New flow > Instant cloud flow
- Name:
XRCopilot - Report On-Demand - Trigger: Manually trigger a flow
- Add a text input to the trigger:
-
Input name:
Question - Input type: Text
-
Input name:
- Add an HTTP action
- Configuration:
| Field | Value |
|---|---|
| Method | POST |
| URI | https://apim-hipexr-prod-italynorth.azure-api.net/api/lab-public/hooks/wh_YOUR_HOOK_ID |
| Headers | (see below) |
| Body | (see below) |
Headers:
Ocp-Apim-Subscription-Key: <YOUR_API_KEY>
X-Api-Key: <YOUR_WEBHOOK_API_KEY>
Content-Type: application/json
Body:
{
"question": "@{triggerBody()['text']}",
"requested_by": "@{triggerBody()['email']}",
"date": "@{utcNow()}"
}- Add a Condition action
- Condition:
Status codeis equal to202 - If yes: continue
- If no: add a Send an email (V2) action with an error notification
- In the If yes branch, add Send an email (V2)
- Subject:
[XRCopilot] Request submitted - Body:
Your request has been received. You will receive the results via email/XRCopilot inbox as soon as they are available.
Note: Results are delivered asynchronously via the output actions configured in the Agent Task (email, webhook, inbox). There is no need to wait inside the flow.
A flow that triggers when a user fills out a Microsoft Form and receives the results via a return webhook.
When to use it: Structured requests from internal users (e.g., analysis requests, document generation).
- Microsoft Forms > New Form
- Suggested fields:
-
Request Type(Choice: Analysis, Report, Q&A) -
Description(Long text) -
Priority(Choice: High, Medium, Low)
-
- Power Automate > New flow > Automated cloud flow
- Trigger: When a new response is submitted (Microsoft Forms)
- Action: Get response details
- Add an HTTP action with:
Body:
{
"request_type": "@{outputs('Get_response_details')?['body/TipoRichiesta']}",
"description": "@{outputs('Get_response_details')?['body/Descrizione']}",
"priority": "@{outputs('Get_response_details')?['body/Priorita']}",
"submitted_by": "@{outputs('Get_response_details')?['body/responder']}"
}Headers: same as Scenario 1.
To receive results in the flow, configure a second flow with a When an HTTP request is received trigger. See the Receiving Results section.
A flow that invokes the agent every day at a preset time.
When to use it: Automatic daily reports, monitoring, digests.
Note: This scenario is an alternative to XRCopilot's native schedule. Use the native schedule when no additional logic is needed in the flow.
- Power Automate > New flow > Scheduled cloud flow
- Frequency: Day, time:
09:00, timezone:(UTC+01:00) Rome
Body:
{
"report_date": "@{formatDateTime(utcNow(), 'yyyy-MM-dd')}",
"report_type": "daily_summary"
}Headers: same as Scenario 1.
When a document is uploaded to a SharePoint document library, the flow invokes the agent to analyze it.
When to use it: Automatic document classification, data extraction, compliance checks.
- Power Automate > New flow > Automated cloud flow
- Trigger: When a file is created (properties only) (SharePoint)
- Configure:
- Site Address: the SharePoint site
- Library Name: the target document library
- Add a Get file properties action (SharePoint)
- Add a Create sharing link for a file or folder action (SharePoint)
-
Link Type:
Organization(internal link) -
Link Scope:
Organization
-
Link Type:
Body:
{
"action": "analyze_document",
"file_name": "@{triggerOutputs()?['body/{FilenameWithExtension}']}",
"file_url": "@{outputs('Create_sharing_link')?['body/link/webUrl']}",
"library": "@{triggerOutputs()?['body/{Path}']}",
"uploaded_by": "@{triggerOutputs()?['body/Author/Email']}"
}If you configure an outbound webhook to receive the results, a second flow can update the SharePoint file metadata with the analysis results:
- Flow with a When an HTTP request is received trigger
- Action: Update file properties (SharePoint)
- Update custom columns (e.g.,
Classification,Summary)
- Update custom columns (e.g.,
Process SharePoint list items in batch, sending them to the agent for analysis or enrichment.
When to use it: Data enrichment, batch analysis, content generation for each item.
- Trigger: Recurrence (e.g., every Monday at 8:00)
- Action: Get items (SharePoint)
- Filter:
Status eq 'Da elaborare'
- Filter:
- Add Apply to each over the item collection
- Inside the loop, add an HTTP action
Body:
{
"item_id": "@{items('Apply_to_each')?['ID']}",
"title": "@{items('Apply_to_each')?['Title']}",
"description": "@{items('Apply_to_each')?['Description']}",
"action": "enrich"
}- After the HTTP action, add Update item to change the status to
In elaborazione
Caution: Respect the rate limit. If the list has many items, use
batchWindowSeconds > 0in the webhook configuration to aggregate the requests.
Integrate XRCopilot into a larger workflow that uses Azure Service Bus to decouple the steps.
When to use it: Enterprise pipelines, multi-system orchestrations, workflows with compensation.
- Azure Portal > Logic Apps > Create > Consumption (or Standard)
- Workflow: Blank Logic App
- Trigger: When a message is received in a queue (auto-complete)
- Queue:
agent-task-requests(or your queue name)
- Action: Parse JSON
- Schema:
{
"type": "object",
"properties": {
"correlationId": { "type": "string" },
"requestType": { "type": "string" },
"payload": { "type": "object" }
}
}- Action: HTTP
URI: https://apim-hipexr-prod-italynorth.azure-api.net/api/lab-public/hooks/wh_YOUR_HOOK_ID
Headers:
Ocp-Apim-Subscription-Key: @{parameters('ApimKey')}
X-Api-Key: @{parameters('WebhookApiKey')}
Content-Type: application/json
Body:
Note: @{...} expressions are evaluated by Logic Apps at runtime; the resulting body is valid JSON.
{
"correlation_id": "@{body('Parse_JSON')?['correlationId']}",
"request_type": "@{body('Parse_JSON')?['requestType']}",
"data": @{body('Parse_JSON')?['payload']}
}
- Configure Run after on the HTTP action:
has failed,has timed out - In the error branch: send a message to the dead letter queue or notify via email
Best practice: Use the Logic App parameters (or Key Vault references) for credentials, not inline values.
Configure the parameters in the designer or in the ARM template:
| Parameter | Type | Value |
|---|---|---|
ApimKey |
SecureString | The APIM subscription key |
WebhookApiKey |
SecureString | The webhook API key |
When an email with specific characteristics arrives, extract the content and invoke the agent with it.
When to use it: Customer support automation, email request analysis, automatic triage.
- Trigger: When a new email arrives (V3) (Office 365 Outlook)
- Filters:
-
Subject Filter:
[Support] - Include Attachments: Yes (if needed)
-
Subject Filter:
Body:
Note: @{...} expressions are evaluated by Logic Apps at runtime; the resulting body is valid JSON.
{
"action": "analyze_email",
"subject": "@{triggerOutputs()?['body/subject']}",
"body": "@{triggerOutputs()?['body/bodyPreview']}",
"sender": "@{triggerOutputs()?['body/from']}",
"received_at": "@{triggerOutputs()?['body/receivedDateTime']}",
"has_attachments": @{triggerOutputs()?['body/hasAttachments']}
}
If the email has attachments:
- Apply to each over the attachments
- Create file (OneDrive/SharePoint) to save the attachment
- Include the link in the webhook payload
To receive execution results in the flow/logic app, configure an HTTP endpoint as an output action in the Agent Task.
- Power Automate > New flow > Automated cloud flow
- Trigger: When an HTTP request is received
- Request Body JSON Schema:
{
"type": "object",
"properties": {
"executionId": { "type": "string" },
"taskId": { "type": "string" },
"taskName": { "type": "string" },
"companyId": { "type": "string" },
"status": { "type": "string" },
"durationMs": { "type": "integer" },
"timestamp": { "type": "string" },
"agentResponse": { "type": "string" },
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fileName": { "type": "string" },
"url": { "type": "string" },
"contentType": { "type": "string" }
}
}
}
}
}Note: as of May 22, 2026, the outbound webhook body is templated. The schema shown above is the default — it is emitted when
bodyTemplateis not configured on the XRCopilot side. If the template is customized, the schema changes accordingly. See the "Custom body templates" section in Webhooks-Agent-Tasks.
- Copy the HTTP POST URL generated by the trigger
- In the Agent Task editor > Output tab
- Enable Outbound Webhook
- Paste the Power Automate trigger URL
- Method:
POST - Include Full Response: enabled
In the receiving flow, after the trigger:
-
Condition:
statusis equal toCompleted -
If yes:
- Save
agentResponseto SharePoint/OneDrive - Send an email with the results
- Update a CRM record
- Save
-
If no:
- Notify the error via Teams/email
-
Response: return
200 OKwith body{ "received": true }
Identical to the Power Automate pattern. Use the When an HTTP request is received trigger and configure the JSON schema as above.
| Problem | Cause | Solution |
|---|---|---|
| HTTP 401 Unauthorized | Missing/incorrect API key or APIM key | Check both headers. The webhook API key is case-sensitive. |
| HTTP 403 Forbidden | Webhook disabled or IP not in whitelist | Verify that the webhook is enabled and that the connector's IP is in the whitelist. |
| HTTP 404 Not Found | Incorrect Hook ID | Check the hookId in the URL (format wh_...). |
| No results received | Output action not configured | Verify that at least one output action (email/webhook/inbox) is enabled in the Output tab. |
| Duplicate results | Receiving flow without deduplication | Use the X-XRCopilot-ExecutionId header (or X-Idempotency-Key) for deduplication. |
| Flow timeout | Execution timeout too low | Increase timeoutSeconds in the Agent Task's Policy tab. |
| Quota exceeded | Too many daily executions | Increase maxDailyExecutions in the Policy tab, or use batching. |
To configure your receiving endpoint's firewall or access rules, outbound webhooks originate from the platform's outbound IPs (Italy North region). Contact your XRCopilot administrator for the up-to-date list of outbound IPs.
- Monitoring tab of the Agent Task: execution statistics, trend charts, quota usage
- Execution Logs: detail of each execution (input, output, duration, errors)
- Delivery Logs: delivery status for each output action (delivered/failed/retrying)
- Webhooks-Agent-Tasks — full technical reference for the Agent Task webhook
- Webhooks-Connections-Action-Steps — invoke external HTTP endpoints from an orchestrator
- REST-API-Reference · Getting-Started · SDK-Overview
© Hevolus Innovation · XRCopilot · Maintained by the XRCopilot team.
Getting Started
API
SDKs
Webhooks & Integrations
- Agent Task Webhooks
- Connections & Action Steps
- Integration Templates
- Authenticated Embed
- Microsoft Agent 365
- Microsoft Teams Notifications
No-code Builders
Orchestrators
Processes
Administration
Reference