How to use the Workflow Builder

Wire blocks, fill in the settings, download one Python file. Every clip on this page is the real Builder, recorded while it was used.

The short version

  1. Wire blocks

    Drag study, loop, check and result blocks onto the canvas and connect them in the order PowerFactory should run them.

  2. Fill in the settings

    Element classes, attributes such as c:loading or m:u, limits and file names. Choices are limited to what fits the block.

  3. Download and run

    Download gives a .zip with one .py script. It runs inside PowerFactory 2024 or from your own Python and saves results tables and graphs to a folder.

Nothing is uploaded. The page runs in your browser, and the script runs on your own computer against your own project.

The screen

The canvas fills the page and four things float over it. Select a part in the list to see where it is.

  1. Toolbar

    Undo and redo, zoom, Fit view, Quick start, save, open, clear the canvas and Download. Its button shows how many problems are left.

  2. Blocks panel

    Every step a workflow can take, in categories, with a search box. Click a block or drag it out. Drag the title bar to move the panel, or use the chevron to fold it.

  3. Canvas

    Your workflow, read left to right. Every workflow begins at the Start block, which is always there. Near the bottom: a minimap and the Wire colours key.

  4. Settings, Python and Problems

    Settings of the selected block, the Python script as it is written, and Problems, the list of what still needs fixing.

Top right, Take a tour replays a one minute walk through a worked example. Other Tools leaves for the rest of the site.

Add a block

Search, then click a block to add it after the selected one, or drag it where you want it. Start is greyed in the panel because it is already on the canvas.

On a phone, press Full screen under a clip and turn the phone sideways to read it.

Blocks panel and canvas
  1. Search

    Type a word such as load flow. The search looks at titles, keywords and descriptions.

  2. Click to add

    The block goes after the selected block (or the last one added), already wired to it.

  3. Or drag

    Drop it anywhere on the canvas. Dropped on a flow wire, it goes between the two steps.

Wires and ports

Blocks connect through ports. Drag from a port on one block to a port on another. Only ports that fit will connect.

Flow wire, then data wire
  1. Flow wire

    A thick wire with an arrow: then do this. It runs from a block's flow output, such as Converged, to the next block.

  2. Data wire

    A thin coloured wire: use this value. It runs from a value output, such as Highest, into an input of another block.

  3. Wire colours

    The colour is the kind of value: number, text, list, time series, element and so on.

  • Unwired flow output. The path ends there. A block says so on its card, for example ends the workflow or skips to the next pass, so no extra block is needed.
  • Drop a wire on empty canvas. A short list opens with only the blocks that fit that wire.
  • +N more. A block shows its main ports and the wired ones. This button on its card shows the rest.

Loops

A loop block repeats whatever is wired to its Each pass output, once per number, item, study case, scenario, variation, element or contingency. What is wired to After all passes runs once, when the loop is done.

For a range of numbers
  1. Add the loop

    For a range of numbers repeats from First to Last in steps. Its Value output is the number of the pass.

  2. Fill Each pass

    New blocks join Each pass. A dashed frame named after the loop shows what is inside it.

  3. Drag from After all passes

    Release on empty canvas to open the list of blocks that fit.

  4. Pick the next step

    It runs once, after the last pass.

  • A pass that cannot finish. If a block such as Did not converge is not wired on, that pass ends and the loop goes to the next one.
  • Contingencies. For each contingency works the same way: the base case first, then each outage on its Each pass.

Settings and problems

Select a block to change its settings. A setting that must be filled in is marked Required. The block shows To do until it is, and the Download button counts what is left.

Settings and Problems
  1. See what is missing

    The Problems tab lists to-dos, errors and warnings. Click one to jump to its block.

  2. Select a block

    Its settings open in the Settings tab. Select nothing to see the whole workflow's settings.

  3. Fill in what is required

    On Start, type the Project exactly as the Data Manager shows it. Letter case counts.

  4. Choose from what fits

    Pick the kind of element, then its name. The attribute box suggests results and parameters for that kind, with their units.

  5. Nothing left to do

    The Download button loses its count. Until then, the script stops before it connects to PowerFactory.

  • Only what can be chosen. A setting appears only where it can change the script, and a list leaves out options that cannot apply.
  • Pin. The pin beside a setting puts it at the top of the Python file, in its SETTINGS section, to change later without the Builder.

Rename a block

Give a block the name you would use for it. The name shows on the canvas, in the Problems list and in the comments of the script.

Double-click a block's name
  1. Double-click the name

    The title on the block turns into a text box.

  2. Type, then press Enter

    Escape keeps the old name.

  3. Or use Settings

    The same name is in Name on the canvas, the first setting of every block.

Quick start

Seven worked examples to start from: headroom study, load flow on every study case, N-1 screening, short circuit at every busbar, the largest dispatch with a safe nadir, fault ride-through and critical clearing time. An empty canvas offers the same list on its Start a workflow card, next to Start blank.

N-1 screening
  1. Open Quick start

    It is in the toolbar. Hover an example to read what it does.

  2. Pick an example

    It replaces the canvas as one undo step, and a message offers Undo. The Builder asks first if you have unsaved work.

  • Then make it yours. Type your project on Start, and change the element names, limits and table names to fit your network.

Results tables and graphs

Results blocks collect values as the workflow runs. Tables are saved when the run ends, graphs are drawn to image files. Both land in the run folder.

Short circuit at every busbar
  1. Add row to results table

    One row per pass: the loop values, then one column per wired value. Rows with the same table name go into one table and one file.

  2. Draw a graph

    Time series, 2D, 3D, heat map, from a results table, or a convergence curve. The block draws a preview from your names and mock values.

  • Skipped passes stay visible. A pass that ends early still gets a row, with the reason in a Status column.
  • File format. On Start, Save the results tables as offers CSV (opens in Excel), Excel (.xlsx) or both. Save results table saves one partway, under another name.
  • One look for every graph. With nothing selected, Graph style in Settings opens templates, from the Adjie Brotools style to IEEE, Elsevier and slides.

Save, open and download

The Builder keeps your workflow in this browser between visits. Save and Download make files you own.

Save, Python tab, Download
  1. Save

    Writes the workflow as a .json file. Open reads it back. It also opens a .py made here, or a file dropped on the canvas.

  2. Read the Python

    The Python tab is written as you build. Copy it, or save only the script with .py.

  3. Download

    Saves the study package as one .zip, ready to unpack and run.

What is in the zip

  • name.py the script
  • name.json the workflow, for the Open button
  • any data file you attached, beside the script
  • fonts/ DM Sans, when graphs use it
  • README.txt how to run it

The bin in the toolbar clears the canvas. It asks first, and Undo brings the work back.

Run the script

  1. Unpack the zip

    Keep the files together: the script looks for its data files next to itself.

  2. Choose how to run it

    Either close PowerFactory and run the script with Python (it starts PowerFactory in the background), or run it from inside PowerFactory. The default, Automatic in Start's How to run setting, handles both.

  3. Run it with Python 3.12

    Use the one that comes with PowerFactory 2024, or any Python 3.12 that can import the powerfactory module.

  4. Collect the results

    Each run writes its tables, graphs and run.log to a new folder beside the script, or inside the Output folder you set on Start.

"C:\Program Files\DIgSILENT\PowerFactory 2024\Python\3.12\python.exe" "name.py"

To change a value later, edit the SETTINGS section at the top of the .py. To change the workflow, open the .json, or the .py itself, in the Builder.

Shortcuts

  • Ctrl Z undo
  • Ctrl Y redo
  • Ctrl C V copy and paste blocks
  • Ctrl D duplicate
  • Ctrl A select every block
  • Delete remove the selection
  • Esc clear the selection

Ready to build one?

Open Builder