Represents the definition of a workflow including its nodes, connections, and metadata. This class provides the blueprint for executing automation workflows.

Members

MemberKindDescription
WorkflowDefinition(string id, string name)MethodInitializes a new instance of the WorkflowDefinition class. The unique identifier for the workflow. The display name of the workflow.
string IdPropertyGets the unique identifier for the workflow.
string NamePropertyGets or sets the display name of the workflow.
string DescriptionPropertyGets or sets the description of what this workflow does.
string VersionPropertyGets or sets the version of this workflow definition.
DateTime CreatedDatePropertyGets the date when this workflow was created.
DateTime? LastModifiedDatePropertyGets or sets the date when this workflow was last modified.
string AuthorPropertyGets or sets the author of this workflow.
List<string> TagsPropertyGets or sets the category or tags for organizing workflows.
bool IsEnabledPropertyGets or sets a value indicating whether this workflow is enabled for execution.
IList<NodeDefinition> NodesPropertyGets the collection of nodes in this workflow.
IList<ConnectionDefinition> ConnectionsPropertyGets the collection of connections between nodes in this workflow.
IList<WorkflowVariable> VariablesPropertyGets the collection of workflow variables.
IList<TriggerDefinition> TriggersPropertyGets the collection of triggers that can start this workflow.
Dictionary<string, object> ConfigurationPropertyGets or sets the global configuration for this workflow.
Dictionary<string, object> MetadataPropertyGets or sets additional metadata about this workflow.
TimeSpan? MaxExecutionTimePropertyGets or sets the maximum execution timeout for this workflow.
ExecutionPriority PriorityPropertyGets or sets the execution priority for this workflow.
void AddNode(NodeDefinition node)MethodAdds a node to the workflow. The node definition to add.
bool RemoveNode(string nodeId)MethodRemoves a node from the workflow and all its connections. The ID of the node to remove. True if the node was removed, false if it was not found.
void AddConnection(ConnectionDefinition connection)MethodAdds a connection between two nodes. The connection definition to add.
bool RemoveConnection(string connectionId)MethodRemoves a connection from the workflow. The ID of the connection to remove. True if the connection was removed, false if it was not found.
IEnumerable<NodeDefinition> GetStartingNodes()MethodGets all nodes that should execute first (nodes with no incoming connections or trigger nodes). Collection of starting node definitions.
IEnumerable<NodeDefinition> GetSourceNodes(string nodeId)MethodGets all nodes that connect to the specified node as input. The ID of the target node. Collection of source node definitions.
IEnumerable<NodeDefinition> GetTargetNodes(string nodeId)MethodGets all nodes that connect from the specified node as output. The ID of the source node. Collection of target node definitions.
ValidationResult Validate()MethodValidates the workflow definition for correctness and completeness. A validation result indicating any issues found.
WorkflowDefinition Clone(string newId = null, string newName = null)MethodCreates a deep copy of this workflow definition. Optional new ID for the copied workflow. Optional new name for the copied workflow. A new WorkflowDefinition instance that is a copy of this one.

Related