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 / Power Automate / Creating a Power Autom...
Power Automate
Unanswered

Creating a Power Automation Desktop Flow Programmatically

(0) ShareShare
ReportReport
Posted on by 5

We are trying to create UI automation workflow through Power automate Desktop programmatically. We tried to export a sample flow, but if we see the workflow folder, inside which is the flow definition json, it is coming in a format which seems to be binary (encoded) and therefore not readable. If we could get the API/SDK from Microsoft regarding this, it would be ideal. However, if it does not exist at all, is there any other approach that can be used ?

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    You can go to any subflow, select all, copy, and paste as text.  It won't convert anything to binary, it will just be raw PAD code, like this:

    DateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime4
    SET KnownFriday TO $'''11/05/2021'''
    DateTime.Subtract FromDate: CurrentDateTime4 SubstractDate: KnownFriday TimeUnit: DateTime.DifferenceTimeUnit.Days TimeDifference=> DateDifference
    SET Weeks TO DateDifference / 7
    Variables.GetIntegerPart Number: Weeks Result=> WeeksTruncated
    DateTime.Add DateTime: KnownFriday TimeToAdd: WeeksTruncated * 7 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate
    Text.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''MMddyyyy''' Result=> FormattedDateTime4
    Display.ShowMessage Title: $'''Result''' Message: FormattedDateTime4 Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed6

  • nikhil_c_mehta Profile Picture
    5 on at

    Thanks @MichaelAnnis  for the prompt response.  While this helps, is there a way we can programmatically do this through file uploads / api / any other mechanism, rather than the manually copying and pasting of the data ?

     

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Look here:

    C:\Users\mannis\AppData\Local\Microsoft\Power Automate Desktop\Console\Workspace

     

    Replace your username.  I only have 2, but part of me thinks that is because these were both back when I had a paid subscription, so if you have a paid subscription, it's possible that all of yours would be saved there.

     

    Each one is a folder:

    MichaelAnnis_0-1638378686746.png

    Inside of that, you want the "script.robin" and it has everything like the copy and paste but more because it's all inclusive.  Also, per files, it looks like the imgrepo and appmask files are important per flowID, I would make sure you have all 3 as a solid backup.

    I found 5 more of my flows here, in the designer folder:

    C:\Users\mannis\AppData\Local\Microsoft\Power Automate Desktop\Designer\Temp

     

    I don't know what the difference is between designer and console, but I have 38 flows, and can only find 7, so hopefully you have better luck.

  • nikhil_c_mehta Profile Picture
    5 on at

    Thanks once again @MichaelAnnis . You have been extremely helpful!. With the above information, we will still struggle to create the process programmatically. We are trying to do something which is illustrated in this video by another product (https://www.youtube.com/watch?v=W5ffNpoZtJg - See from 9:20 - 10:00). Please let me know if you have any bright ideas or alternative way to achieve this.

     

    Thanks once again.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    So, when you say you are trying to create one programmatically, I am not sure want you mean.  I thought you were saying that you wanted to find a systematic way to export one.  If you are just looking for a sample, so you can create your own text version, those script.robin text files are the ones you need to follow.  I recently learned, in PAD, you can open a flow, and a temp file will go here:
    C:\Users\mannis\AppData\Local\Microsoft\Power Automate Desktop\Designer\Temp

    The flow has to be physically opened in PAD.  There might be a few files/folders lingering in there (maybe I closed PAD without closing the open flow first; however, using today's date as the "last modified", I could easily find the temp folder for my flow.  Inside were the 3 files required:

    MichaelAnnis_0-1638463718684.png

    Bring the script.robin into notepad and you can start to learn how to create a PAD from just text.  I'm sorry if I'm not understanding your needs.  Good luck!

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Check out this link, apparently, there is a response regarding programmatically creating flows based off other triggers:
    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/programmatically-create-a-flow/idi-p/112491

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 225

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard