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
Answered

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

(0) ShareShare
ReportReport
Posted on by 3

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)
  • Verified answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 277

#2
11manish Profile Picture

11manish 206

#3
sannavajjala87 Profile Picture

sannavajjala87 156 Super User 2026 Season 1

Last 30 days Overall leaderboard