Class: Tasker::Types::GraphNode

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/tasker/types/dependency_graph.rb

Overview

Represents a single node in a dependency graph

A node can represent either a step template (for template graphs) or a workflow step instance (for runtime graphs).

Examples:

Template graph node

node = GraphNode.new(
  id: 'validate_payment',
  name: 'validate_payment',
  type: 'step_template',
  metadata: { retryable: true, retry_limit: 3 }
)

Runtime graph node

node = GraphNode.new(
  id: '12345',
  name: 'validate_payment',
  type: 'workflow_step',
  state: 'complete',
  readiness_status: { ready_for_execution: false },
  metadata: { step_class: 'ValidatePaymentStep' }
)

Instance Attribute Summary collapse

Instance Attribute Details

#idString (readonly)

Returns Node identifier.

Returns:

  • (String)

    Node identifier



36
# File 'lib/tasker/types/dependency_graph.rb', line 36

attribute :id, Types::String

#metadataHash (readonly)

Returns Node metadata.

Returns:

  • (Hash)

    Node metadata



66
# File 'lib/tasker/types/dependency_graph.rb', line 66

attribute :metadata, Types::Hash.default({}.freeze)

#nameString (readonly)

Returns Node name.

Returns:

  • (String)

    Node name



42
# File 'lib/tasker/types/dependency_graph.rb', line 42

attribute :name, Types::String

#readiness_statusHash? (readonly)

Returns Step readiness information.

Returns:

  • (Hash, nil)

    Step readiness information



60
# File 'lib/tasker/types/dependency_graph.rb', line 60

attribute? :readiness_status, Types::Hash.optional

#stateString? (readonly)

Returns Current state of the step.

Returns:

  • (String, nil)

    Current state of the step



54
# File 'lib/tasker/types/dependency_graph.rb', line 54

attribute? :state, Types::String.optional

#typeString (readonly)

Returns Node type.

Returns:

  • (String)

    Node type



48
# File 'lib/tasker/types/dependency_graph.rb', line 48

attribute :type, Types::String