HTTP, EVENTS & ACTIVITY

Send HTTP Requests & Event Activities

Learn how to extend your Copilot Studio agents by connecting to external APIs and triggering event-driven workflows. With HTTP Request nodes, you can fetch, submit, and manipulate data from external systems. Using Event and Activity nodes, your agent can perform asynchronous actions, communicate with client-side tools, and handle system-level events without direct user messages.

This guide covers how to configure HTTP requests with headers, body content, and error handling, as well as how to send events, invoke client tasks, and orchestrate activities to create powerful, context-aware, and interactive agents in Copilot Studio.

🔧 What is the HTTP Request Node?

The HTTP Request node lets your agent:

  • 🔍 Retrieve data (GET)
  • ➕ Send new data (POST)
  • ✏️ Update data (PUT / PATCH)
  • ❌ Delete data (DELETE)

In short, it allows your bot to talk to any REST API.

📌 Prerequisite

Before using it, make sure you can create and edit topics in Copilot Studio.

⚙️ How to Add an HTTP Request

  • Click ➕ Add node
  • Go to Advanced
  • Select Send HTTP request
  • Enter API URL and choose method (GET, POST, PUT, PATCH, DELETE)

🧾 Headers: Small but Important

Headers are optional—but often required.

  • Authorization: Bearer <token>
  • Content-Type: application/json

Use headers when API requires authentication or specific formats.

📦 Request Body

By default, no body is sent (common for GET).

You can add content when needed.

JSON Content

Used in POST, PUT, PATCH requests. You can provide JSON and also use Power Fx for dynamic values.

Raw Content

Send plain text or custom formats using Power Fx formulas.

📥 Handling the Response

After the API responds, you need to store and use the data.

  • Use sample JSON to generate schema
  • Enables IntelliSense in Power Fx
  • Store response in a new or existing variable

⚠️ Default Behavior

  • Agent stops if request fails
  • Triggers On Error system topic

✅ Continue on Error

  • Agent continues execution
  • Stores status code and error response
  • Useful for fallback scenarios

⚡ Important Notes

  • Error response type is Any
  • Use Parse Value node to convert into structured data

⏱️ Timeout Setting

  • Default timeout: 30 seconds
  • Configurable in milliseconds
  • If exceeded, request fails

🧠 Key Tips You Should NOT Miss

  • Always check API documentation
  • Use sample JSON for schema
  • Use Power Fx for dynamic values
  • Handle errors properly
  • Test APIs externally before using

🎯 When Should You Use HTTP Requests?

  • Fetch real-time data
  • Submit forms
  • Integrate external systems (CRM, APIs)

Send an Event or Activity

Beyond messages, Copilot Studio allows your agent to communicate using events and activities. This unlocks advanced scenarios like triggering workflows, interacting with client-side tools, and handling system-level communication.

What is the Activity Protocol?

The activity protocol is a core concept in Copilot Studio that enables seamless communication between users and agents. It defines a standardized structure for all interactions.

There are different activity types, but the most important ones are:

  • Message Activities: Used for direct communication like text, media, or adaptive cards.
  • Event Activities: Used for system-level or nonverbal communication.

💬 Message Activities

These are the most common interactions where users ask questions and agents respond. They carry text, media, or adaptive cards and are used for direct conversations.

⚡ Event Activities

These represent system-triggered actions or updates. They work asynchronously and do not require direct user interaction.

Sending Events

The Event activity node allows your agent to send event-based signals. These events are intercepted by the channel, which decides how to use them.

  • You must provide a name for the event
  • You can attach a value to the event

The value can be:

  • A primitive value
  • A variable reference
  • A Power Fx formula

The value is serialized as JSON and sent with the activity.

🎯 Common Use Cases

  • Trigger custom actions in Web Chat
  • Control external services like call recording
  • Notify UI about changes (user joins, updates, etc.)

Using Client-Side Tools

In orchestration, tools are not just server APIs. You can also execute tools on the client using event activities.

  • Agent sends an event with inputs
  • Client performs the action
  • Client sends back the result as another event
  • Agent continues execution using the result

📦 Sample Payload (Client Tool Execution)

Agent request:

{
  "type": "event",
  "name": "getSlideContent",
  "value": { "page": 5 }
}
    

Client response:

{
  "type": "event",
  "name": "getSlideContent",
  "value": { "content": "QA slide. Next steps" }
}
    

Setting Up Client Tools

There are two ways to register client tools:

  • Define them inside your agent topic using YAML
  • Set them dynamically using system variables
YAML Example
schemaName: GetSlideContent
kind: InvokeClientTaskAction
inputs: page (Number, required)
outputs: content (String)
    
Dynamic Tools
System.ClientPluginActions = [ ... ]
    
⌨️ Typing

Sends typing indicator to the user interface.

🔁 Invoke

Used in Microsoft Teams to handle invoke requests and responses.

📞 Handoff

Transfers control to external systems like AudioCodes.

⚠️ Important Notes You Should Not Miss

  • Event activities are handled by the channel—not always visible to users
  • They enable asynchronous workflows
  • Client tools rely on proper request-response event handling
  • Incorrect schema or payload can break orchestration

🏁 Final Thoughts

The HTTP Request node and event/activity capabilities are among the most powerful features in Copilot Studio, enabling your agent to go far beyond basic messaging.

With HTTP requests, your agent can connect to external systems, retrieve real-time data, and perform operations. At the same time, event and activity nodes unlock advanced, event-driven communication—allowing interaction with client-side tools, triggering workflows, and handling asynchronous scenarios.

  • Handle errors properly
  • Structure data correctly
  • Do not ignore timeout and response handling
  • Ensure correct event payloads and schemas

Once you understand both API integration and event-driven communication, your agent can evolve from a basic chatbot into a highly interactive, intelligent, and context-aware assistant that integrates seamlessly with both client and server systems.