web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Is there a way to exec...
Copilot Studio
Suggested Answer

Is there a way to execute Python code from a Copilot Studio workflow ?

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I’m building a workflow (agent flow / Power Automate flow) in Microsoft Copilot Studio and I’m trying to understand what is the simplest and recommended way to execute a small piece of Python code as part of the workflow.

 

My use case :


  • I want to call / execute a Python script in the middle of my workflow (and I want to send arguments / variables from my workflow variables to this script)


  •  

From what I have seen, Copilot Studio workflows does not seem to natively support running Python code, but I’m unsure what approach Microsoft currently recommends as the simplest option / as a workaround.


     

If there is official guidance or a recommended pattern for 2026 Copilot Studio workflows, I’d really appreciate clarification.

 

As said, I am currently in Copilot Studio Flow (copilotstudio.microsoft.com), not an agent, not Azure Logic App, not Power Automate.

 

Here is a screenshot to clarify. Is there a way / work around to have an "action" block that can natively execute Python code ? If not, what is the simplest way to acheive it ? 

 

 

Thank you !


     
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,039 Moderator on at
     
    Copilot Studio workflows don’t support running Python code natively. The recommended pattern is to host your Python logic externally (typically as an Azure Function with an HTTP trigger) and call it from the flow using an HTTP action. This is the simplest and Microsoft‑supported way to execute Python as part of a Copilot Studio workflow.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

    Sunil Kumar Pashikanti, Moderator
    Blog:
     https://sunilpashikanti.com/posts/
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 704

#2
Vish WR Profile Picture

Vish WR 249

#3
Haque Profile Picture

Haque 244

Last 30 days Overall leaderboard