Class: RCrewAI::Process::Sequential

Inherits:
Base
  • Object
show all
Defined in:
lib/rcrewai/process.rb

Instance Attribute Summary

Attributes inherited from Base

#crew, #logger

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RCrewAI::Process::Base

Instance Method Details

#executeObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rcrewai/process.rb', line 32

def execute
  log_execution_start
  results = []

  crew.tasks.each do |task|
    @logger.info "Executing task: #{task.name}"
    begin
      result = task.execute
      results << { task: task, result: result, status: :completed }
    rescue StandardError => e
      @logger.error "Task #{task.name} failed: #{e.message}"
      results << { task: task, result: e.message, status: :failed }
    end
  end

  log_execution_end(results)
  results
end