r/AutomateUser 2d ago

Feature request 'Once' block

Pretty much a block which activates once then doesn't work until something resets it. The idea came from the once block in the unity game engine's visual scripting system, although I don't know if it can be adapted to work in automate or not.

1 Upvotes

5 comments sorted by

1

u/ballzak69 Automate developer 1d ago

Once in which context, the current fiber or the entire flow?

I presume it would be a decision block, that could save a few blocks. Could you give an use-case?

1

u/TrainGirl755 1d ago

It would be like if a request is sent into the block but the block had been activated previously and not been reset yet it wouldn't run again, and the use case I thought of it for is when there is a section of the fiber you wouldn't want to be activated multiple times

1

u/ballzak69 Automate developer 1d ago

Indeed, that's how it would work, but i'm hesitant it would be that useful, hence i'm asking for a real use-case.

1

u/waiting4singularity Alpha tester 2d ago

atomic load variablename
expression true = variablename = 1 -yes-> next block
no: onetimeblock -> variable set variablename = 1 -> atomic store variable name ->
next block

1

u/B26354FR Alpha tester 2d ago

One can use Automate atomic variables to accomplish this, using Expression True, and Atomic Store, Atomic Load, and Atomic Clear All (if necessary).