# How to safely refresh Flow Diagram (vCortex) in Perspective?

**URL:** <https://forum.inductiveautomation.com/t/how-to-safely-refresh-flow-diagram-vcortex-in-perspective/114164>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 25, 2026, 5:24am UTC](https://forum.inductiveautomation.com/t/how-to-safely-refresh-flow-diagram-vcortex-in-perspective/114164 "2026-02-25T05:24:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drey](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@drey](https://forum.inductiveautomation.com/u/drey)\
**Post date:** [February 25, 2026, 5:24am UTC](https://forum.inductiveautomation.com/t/how-to-safely-refresh-flow-diagram-vcortex-in-perspective/114164/1 "2026-02-25T05:24:49Z")

</div>

Hi, I’m trying to refresh the vCortex **Flow Diagram** component from a button click.

I clear the nodes/edges and then call my `loadFlow()` function:

```python
flow.props.nodes = []
flow.props.edges = []
flow.props.layouting.autoLayout = False
self.view.custom.flowNodes = []

time.sleep(0.1) # temporary delay
self.loadFlow()

```

Because Perspective property writes are async, the load runs before the clear finishes, causing inconsistent results.

`invokeLater` does not work in Perspective from this scope, and I know using `sleep()` is not ideal.

**Question:**

What is the correct or recommended way in Perspective to add a small delay or queue the load so it runs _after_ the clear is applied?

Thanks!

---

<div class="post-metadata">

**Author:** ![lane.duncan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lane.duncan/32/83700_2.png) [@lane.duncan](https://forum.inductiveautomation.com/u/lane.duncan)\
**Post date:** [March 1, 2026, 6:41am UTC](https://forum.inductiveautomation.com/t/how-to-safely-refresh-flow-diagram-vcortex-in-perspective/114164/2 "2026-03-01T06:41:33Z")

</div>

Searching for the word “delay” in the forum brings up a lot of suggestions….some are better than others.

My favorite method when needing a timer on a Perspective view is to use a custom prop like this:

> [@How to Close a Perspective Popup Asynchronously After a Delay in Ignition?](https://forum.inductiveautomation.com/t/how-to-close-a-perspective-popup-asynchronously-after-a-delay-in-ignition/99869/4):
>
> In Project Browser, select the root of your view. In Perspective Property Editor scroll down to CUSTOM. Create a new custom property startTime. Create an expression binding on startTime with the expression, now(0). This will fire once when the popup opens and save the current timestamp in the custom property. Create a second tag, timeout. Add an expression binding, (now(1000) - {this.custom.startTime}) \> 5000 This will evaluate every 1000 ms and will return true when the popup has been …

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [March 1, 2026, 8:12pm UTC](https://forum.inductiveautomation.com/t/how-to-safely-refresh-flow-diagram-vcortex-in-perspective/114164/3 "2026-03-01T20:12:44Z")

</div>

it seems you have problem and need this delay to make autoLayouting work. In that you can use system.util.invokeAsynchronous() and add your sleep timer inside.

I believe in next release we can an event to fire when the Flow diagram internal loading of nodes and edges are finished.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [March 1, 2026, 9:59pm UTC](https://forum.inductiveautomation.com/t/how-to-safely-refresh-flow-diagram-vcortex-in-perspective/114164/4 "2026-03-01T21:59:39Z")

</div>

It’d be nice if there was a first party way to submit functions to the back of the session’s queue.

`invokeAsynchronous` is pretty heavy handed when all you’re trying to do is run a function after property assignments are complete.

I have an unmerged `system.perspective.queueSubmit` function in Embr Periscope that does exactly this:

> <https://github.com/mussonindustrial/embr/blob/feat/periscope/runOnQueue/modules/periscope/gateway/src/main/kotlin/com/mussonindustrial/ignition/embr/periscope/scripting/QueueFunctions.kt#L68C5-L135C6>

Unmerged because I got busy and never finished testing it all the way.
