Get a lock on a Connection to prevent multiple instances of a Workflow from running simultaneously

Revision History

1.0.0.0 Initial Release

1.0.0.1 Added timeout property

Properties

Connection

Type: Connection Input

The Connection does not have any properties. The Connection should be named according to the process on which the mutex should be applied, and the Workflow(s) that act on that process should use a Mutex Node with this Connection.

TimeoutSeconds

Type: Int32 Input

This is the timeout on the that the current node should consider the existing lock as stale. If the timeout is zero, the existing lock will never be considered stale.

When a lock is added with a timeout of 10 seconds, and a second workflow try to obtain a lock an hour later with a timeout of 2 hours, it will fail because the current lock is less than 2 hours, so it is not considered stale by the current node.

ForceRelease

Type: Boolean

When checked, the current lock will be released regardless of the TimeoutSeconds

Remarks

The Mutex Node will get a lock on the Connection for the specific Environment that the Workflow is running under when it is first run. When the processing is done downstream from the Locked output, the Node will execute again, and this time the Released output will fire.

When a second instance of the Workflow is executed while the Connection is locked, the Node will error.

On version 1.0.0.0 a lock will be considered stale after 1 hour

Example

See https://flowgear.me/s/GAsOHfO for an example workflow

Did this answer your question?