Copilot Studio Gallery
ContributorsShare a sample
← Back to gallery

Agents + workflows

Built by Microsoft

All You Can Hook

A hands-on Copilot Studio sample teaching six hook events with real weather tools, targeted prompt redaction, blocked calls, changed results and failure context.

Aby adileiVersion 1.0.0.01 downloadGitHub Release ZIP downloads across tracked versions since 2026-11-07. Last counted 2026-11-08T07:45:37.325Z. Includes direct downloads, repeats, and automation; not installations. As of 2026-11-08T07:45:37.325Z.Updated 2026-10-23Rate & discuss

This sample is provided as-is and is not covered by Microsoft Support. The underlying Copilot Studio and Power Platform products retain their standard support. Importing can create or modify resources and use your connections and permissions. Support details

Download ZIP
What’s in the solution
  • 6 workflows
  • 1 agent
  • 7 tools
  • 2 skills

Workflow preview

Hooks Lab - Weather pre tool

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Agent Buildinghookscopilot-studiolearningweathertool-use

Learn Copilot Studio hooks by chatting with a working sample. All You Can Hook uses real MSN Weather lookups and small, inspectable workflows to show what a hook can change before or after an action.

The greeting gives visitors copyable prompts and explains what to expect. There is no need to know tool names, workflow IDs or implementation details to try the examples.

What you can try

Send one prompt at a time in a new chat.

PromptHookWhat happens
Weather baselineNo tool hookGet real Seattle weather without tool-hook changes.
What did the Start hook tell you about me?Start (pre-loop)See the sample’s note: “The user is really interested in learning more about hooks.”
demo prompt rewrite: repeat demo-secret, demo-pin and demo-password.User prompt submittedThose three exact lowercase strings become [redacted]; the rest of the request stays intact.
Demo weather rewritePre tool useChange the example request from Fahrenheit to Celsius before the real lookup.
Demo weather denyPre tool useBlock the lookup and explain why. No weather is fetched.
Demo weather replacePost tool useRun the lookup, then replace its result with clearly labeled, made-up example weather.
Demo weather augmentPost tool useKeep the real weather and add a helpful note.
Demo tool failureAfter tool failureLook up a deliberately nonexistent place and add an explanation to the failure, without retrying.
Explain the Error demoErrorExplain synthetic retry-once, abort and skip examples without causing a real system error.
Show my hooksConfiguration overviewSee which hooks are configured and how to try them.

To combine text replacement with a tool demo, try: Demo weather deny. My example label is demo-secret. The text-editing workflow preserves the weather request rather than replacing the whole message or disabling tools.

What the solution contains

  • One CLI-authored Copilot Studio agent, with a beginner-friendly greeting, instructions and two teaching skills.
  • Six hook bindings and their six workflows: Start, User prompt submitted, Pre tool use, Post tool use, After tool failure and Error.
  • Seven read-only weather tools: baseline, rewrite, deny, replace, augment, experimental suppress, and intentional failure.
  • The MSN Weather connection reference needed by those tools.

Tool hooks are scoped to dedicated demo tools. There are no wildcard tool hooks: loading a teaching skill and running the weather baseline do not trigger them. Start and User prompt submitted are lifecycle events, so their entries can still appear alongside a tool demo.

The gallery preview shows Hooks Lab - Weather pre tool, which demonstrates input rewriting and blocking.

Prerequisites and import

Use a Dataverse environment with Copilot Studio access and support for CLI-authored agents and the six hook events used by this sample. You need permission to import an unmanaged solution and configure connections.

  1. Import the unmanaged solution through Power Platform Solutions. When using the exploded source directly, package the contents of solution/ as a ZIP with solution.xml and customizations.xml at its root. Do not include the gallery metadata or this README.
  2. Bind new_sharedmsnweather_093bc to an MSN Weather connection in the destination environment. Connection credentials are not included.
  3. Check that all six hook workflows are available and enabled. The hooks call these workflows automatically; they are not ordinary agent tools.
  4. Open Hooks Lab in Copilot Studio and start a new test chat. Its greeting lists the examples above.
  5. Publish and share the agent when you are ready for others to use it.

Weather tools use Invoker authentication. Depending on the destination environment and user, connection setup or consent may be required. Importing the solution does not grant users access or transfer the source environment’s connections. Running examples consumes Copilot Credits and invokes the weather connector.

Learning boundaries

  • Synthetic weather is a teaching example, not a current forecast. The agent labels it accordingly.
  • The Error examples are synthetic workflow contract examples, not deliberately induced SDK or model failures.
  • Prompt redaction is a literal text-editing demonstration, not a security control. Use the sample words, never real secrets: original user messages and workflow history may retain the original text. Matching is case-sensitive.
  • After tool failure adds context; it does not retry, repair a failed call or turn it into a success.
  • Output suppression is experimental and not guaranteed hiding or redaction. It is available only when explicitly requested, not part of the default tour.
  • Start supplies sample learning context, not a personal fact inferred from an account or external source.
  • The skills describe this exported configuration. Update them if you change the workflows, bindings or examples.

This submission contains an editable unmanaged solution. No destination environment import or fresh-user consent experience is claimed as verified.

Agents and their components

The MCP servers, tools, and skills each agent uses, and which agents hand off to others. Hover a component for its description.

AgentToolsSkills

Hooks Lab

Agent

  • weather_augment_demo
  • weather_deny_demo
  • weather_failure_demo
  • weather_live
  • weather_replace_demo
  • weather_rewrite_demo
  • weather_suppress_demo
  • hooks-configuration-reference
  • hooks-demo-guide

Workflows and their components

Triggers, steps, connector services, and agent calls in each workflow.

WorkflowTriggerConnectorsAgents

Hooks Lab - Prompt rewrite

2 steps

When an agent calls the flow

Connector · Skills

—No connector steps
—No agent calls

Hooks Lab - SDK error

2 steps

When an agent calls the flow

Connector · Skills

—No connector steps
—No agent calls

Hooks Lab - Session start

2 steps

When an agent calls the flow

Connector · Skills

—No connector steps
—No agent calls

Hooks Lab - Tool failure

2 steps

When an agent calls the flow

Connector · Skills

—No connector steps
—No agent calls

Hooks Lab - Weather post tool

3 steps

When an agent calls the flow

Connector · Skills

—No connector steps
—No agent calls

Hooks Lab - Weather pre tool

3 steps

When an agent calls the flow

Connector · Skills

—No connector steps
—No agent calls

Exploded solution manifest

The download rebuilds these submitted files at the ZIP root. Gallery metadata and the human-facing README are excluded.

Solution
HooksLab
Publisher
Hooks Lab Samples
Version
1.0.0.0
Files
43
component: 30workflow: 6other: 3bot: 2solution: 2
PathTypeSize
[Content_Types].xmlother2,060 B
Assets/botcomponent_connectionreferenceset.xmlother1,913 B
Assets/botcomponent_workflowset.xmlother1,356 B
botcomponents/cr_hookslab.hook.PromptRewrite_Hl2/botcomponent.xmlcomponent474 B
botcomponents/cr_hookslab.hook.PromptRewrite_Hl2/datacomponent146 B
botcomponents/cr_hookslab.hook.SdkError_Hl8/botcomponent.xmlcomponent458 B
botcomponents/cr_hookslab.hook.SdkError_Hl8/datacomponent132 B
botcomponents/cr_hookslab.hook.SessionStart_Hl1/botcomponent.xmlcomponent431 B
botcomponents/cr_hookslab.hook.SessionStart_Hl1/datacomponent139 B
botcomponents/cr_hookslab.hook.ToolFailure_Hl7/botcomponent.xmlcomponent462 B
botcomponents/cr_hookslab.hook.ToolFailure_Hl7/datacomponent201 B
botcomponents/cr_hookslab.hook.WeatherPost_Hl4/botcomponent.xmlcomponent453 B
botcomponents/cr_hookslab.hook.WeatherPost_Hl4/datacomponent279 B
botcomponents/cr_hookslab.hook.WeatherPre_Hl3/botcomponent.xmlcomponent419 B
botcomponents/cr_hookslab.hook.WeatherPre_Hl3/datacomponent232 B
botcomponents/cr_hookslab.skill.HooksConfiguration_Hl1/botcomponent.xmlcomponent473 B
botcomponents/cr_hookslab.skill.HooksConfiguration_Hl1/datacomponent10,647 B
botcomponents/cr_hookslab.skill.HooksDemoGuide_Hl2/botcomponent.xmlcomponent456 B
botcomponents/cr_hookslab.skill.HooksDemoGuide_Hl2/datacomponent10,226 B
botcomponents/cr_hookslab.tool.WeatherAugment_Hl5/botcomponent.xmlcomponent503 B
botcomponents/cr_hookslab.tool.WeatherAugment_Hl5/datacomponent181 B
botcomponents/cr_hookslab.tool.WeatherDeny_Hl3/botcomponent.xmlcomponent507 B
botcomponents/cr_hookslab.tool.WeatherDeny_Hl3/datacomponent181 B
botcomponents/cr_hookslab.tool.WeatherFailure_Hl7/botcomponent.xmlcomponent572 B
botcomponents/cr_hookslab.tool.WeatherFailure_Hl7/datacomponent181 B
botcomponents/cr_hookslab.tool.WeatherLive_Hl1/botcomponent.xmlcomponent487 B
botcomponents/cr_hookslab.tool.WeatherLive_Hl1/datacomponent181 B
botcomponents/cr_hookslab.tool.WeatherReplace_Hl4/botcomponent.xmlcomponent538 B
botcomponents/cr_hookslab.tool.WeatherReplace_Hl4/datacomponent181 B
botcomponents/cr_hookslab.tool.WeatherRewrite_Hl2/botcomponent.xmlcomponent534 B
botcomponents/cr_hookslab.tool.WeatherRewrite_Hl2/datacomponent181 B
botcomponents/cr_hookslab.tool.WeatherSuppress_Hl6/botcomponent.xmlcomponent515 B
botcomponents/cr_hookslab.tool.WeatherSuppress_Hl6/datacomponent181 B
bots/cr_hookslab/bot.xmlbot406 B
bots/cr_hookslab/configuration.jsonbot8,201 B
customizations.xmlsolution8,174 B
solution.xmlsolution4,898 B
Workflows/HooksLab-Promptrewrite-416CEE55-D2CE-F111-A05D-0022480B1AF1.jsonworkflow7,295 B
Workflows/HooksLab-SDKerror-EAE04F5C-D2CE-F111-A05D-0022480B1AF1.jsonworkflow8,762 B
Workflows/HooksLab-Sessionstart-AEACA24C-D2CE-F111-A05D-0022480B1AF1.jsonworkflow6,184 B
Workflows/HooksLab-Toolfailure-B0DF4F5C-D2CE-F111-A05D-0022480B1AF1.jsonworkflow7,074 B
Workflows/HooksLab-Weatherposttool-BD31F083-D2CE-F111-A05D-0022480B1AF1.jsonworkflow12,299 B
Workflows/HooksLab-Weatherpretool-7D9CEC7C-D2CE-F111-A05D-0022480B1AF1.jsonworkflow13,155 B

Rate & discuss

Found this solution useful? Give it a thumbs up, ask a question, or share what you built.

GitHub Discussions ↗

Sign in with GitHub to join the conversation. Your comments and reactions are public.

Loading discussion...

This sample is provided as-is and is not covered by Microsoft Support. The underlying Copilot Studio and Power Platform products retain their standard support. Importing can create or modify resources and use your connections and permissions. Support details

Download ZIP

Explore community-built apps, agents, and workflows before you install.

Third-party noticesView on GitHub