Skip to content

New sample how to invoke Power Automate flow from declarative agent#141

Open
reshmee011 wants to merge 4 commits into
pnp:mainfrom
reshmee011:main
Open

New sample how to invoke Power Automate flow from declarative agent#141
reshmee011 wants to merge 4 commits into
pnp:mainfrom
reshmee011:main

Conversation

@reshmee011
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new TypeSpec-based declarative agent sample intended to invoke a Power Automate HTTP-triggered flow (e.g., sending an email) via Microsoft 365 Agents Toolkit.

Changes:

  • Introduces TypeSpec agent + action definitions for invoking a Power Automate flow.
  • Adds Agents Toolkit pipelines (provision/publish) and a script to generate env.tsp from .env.*.
  • Adds sample documentation and VS Code workspace scaffolding.

Reviewed changes

Copilot reviewed 16 out of 22 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
samples/da-typespec-powerautomate/tspconfig.yaml Configures OpenAPI3 + M365 Copilot emitters and output locations.
samples/da-typespec-powerautomate/src/agent/prompts/instructions.tsp Adds the agent instruction prompt guiding flow invocation.
samples/da-typespec-powerautomate/src/agent/main.tsp Declares the agent and exposes the Power Automate action.
samples/da-typespec-powerautomate/src/agent/actions/invokePAFlow.tsp Defines the Power Automate “sendEmail” action, schema, and OAuth2 auth model.
samples/da-typespec-powerautomate/scripts/generate-env.js Generates src/agent/env.tsp from env/.env.{environment}.
samples/da-typespec-powerautomate/README.md Documents setup and usage steps for the sample.
samples/da-typespec-powerautomate/package.json Adds compile + env-generation scripts and TypeSpec dependencies.
samples/da-typespec-powerautomate/package-lock.json Locks dependency graph for the sample.
samples/da-typespec-powerautomate/m365agents.yml Adds provision/publish pipelines for compiling and packaging the agent.
samples/da-typespec-powerautomate/m365agents.local.yml Adds local provisioning pipeline for the agent.
samples/da-typespec-powerautomate/env/.env.dev Provides dev environment variables template for Power Automate endpoints.
samples/da-typespec-powerautomate/AGENTS.md Adds TypeSpec/agent authoring guidance for contributors.
samples/da-typespec-powerautomate/.vscode/tasks.json Adds VS Code tasks for local provisioning/debug flows.
samples/da-typespec-powerautomate/.vscode/settings.json Configures workspace settings (read-only generated files, schema stubs).
samples/da-typespec-powerautomate/.vscode/launch.json Adds browser launch configurations for Copilot preview.
samples/da-typespec-powerautomate/.vscode/extensions.json Recommends Agents Toolkit + TypeSpec extensions.
samples/da-typespec-powerautomate/.gitignore Ignores generated output and local env artifacts.
Files not reviewed (1)
  • samples/da-typespec-powerautomate/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread samples/da-typespec-powerautomate/.vscode/tasks.json Outdated
Comment thread samples/da-typespec-powerautomate/m365agents.yml Outdated
Comment thread samples/da-typespec-powerautomate/m365agents.yml Outdated
Comment thread samples/da-typespec-powerautomate/m365agents.yml
Comment thread samples/da-typespec-powerautomate/m365agents.yml
Comment on lines +62 to +64
authorizationUrl: "https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/authorize";
tokenUrl: "https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/token";
refreshUrl: "https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/refresh";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garrytrinder : I can't use string interpolation with the oAuth2Auth,
image
I have specified within the Readme file to amend those placeholders.

Comment thread samples/da-typespec-powerautomate/scripts/generate-env.js Outdated
Comment thread samples/da-typespec-powerautomate/env/.env.dev Outdated
Comment thread samples/da-typespec-powerautomate/m365agents.yml
Copy link
Copy Markdown
Member

@garrytrinder garrytrinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @reshmee011 can you address the comments, then we can merge.

Comment thread samples/da-typespec-powerautomate/m365agents.yml Outdated
Copy link
Copy Markdown
Collaborator

@sebastienlevert sebastienlevert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve Copilot comments, rest is great!

@reshmee011
Copy link
Copy Markdown
Contributor Author

Thanks @garrytrinder for the review. There’s just one outstanding Copilot comment left. I’m not sure how to reference an environment variable within the oAuth2Auth object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants