anchor.diff:      let findEventTypeById eventId (evts : HistoryEvent seq) =
           evts |> Seq.pick (function | { EventId = eventId'; EventType = eventType } when eventId = eventId' -> Some eventType | _ -> None)
   
  -    let getStageActionId actionName { StageNumber = stage; AttemptNumber = n } = sprintf "%d.%s.attempt_%d" stage actionName n
  +    let getStageActionId actionName { StageNumber = stage; AttemptNumber = n } = 
  +        sprintf "%d.%s.attempt_%d.%s" stage actionName n (Guid.NewGuid().ToString().Substring(0, 8))
       let getActivityVersion stageNum = sprintf "%s.%d" name stageNum
   
       // sort the stages by Id
       let stages = defaultArg stages [] |> List.sortBy (fun { StageNumber = n } -> n)
  +
  +    // all the activities (including those part of a schedule multiple action)
  +    let activities = stages |> List.collect (function 
  +            | { Action = ScheduleActivity(activity) } -> [ activity ]
  +            | _ -> [])
  +
  +    // all the child workflows (including those part of a schedule multiple action)
  +    let childWorkflows = stages |> List.collect (function 
  +            | { Action = StartChildWorkflow(workflow) } -> [ workflow ]
  +            | _ -> [])
       
       /// tries to get the nth (zero-index) stage
       let getStage n = if n >= stages.Length then None else List.nth stages n |> Some
  
positive.code:     [<CLIEvent>] member this.OnWorkflowCompleted = onWorkflowCompleted.Publish
  
      // #endregion
  
      // #region Properties
  
      member this.Name                         = name
      member this.Version                      = version
      member this.TaskList                     = taskList
      member this.TaskStartToCloseTimeout      = taskStartToCloseTimeout
      member this.ExecutionStartToCloseTimeout = execStartToCloseTimeout
      member this.ChildPolicy                  = childPolicy
      member this.MaxAttempts                  = maxAttempts
      member this.NumberOfStages               = stages.Length    
  
      // #endregion
  
      member this.Start swfClt = 
          register swfClt |> ignore
          startDecisionWorker  swfClt
          startActivityWorkers swfClt
  
          // start any child workflows
          stages 
          |> List.choose (function | { Action = StartChildWorkflow(workflow) } -> Some workflow | _ -> None)
          |> List.iter (fun workflow -> workflow.Start swfClt)
  
      // #region Operators
  
      static member (++>) (workflow : Workflow, activity : IActivity) = workflow.Append(ScheduleActivity, activity)
      static member (++>) (workflow : Workflow, childWorkflow : Workflow) = 
          if childWorkflow.ExecutionStartToCloseTimeout.IsNone then failwithf "child workflows must specify execution timeout"
          if childWorkflow.TaskStartToCloseTimeout.IsNone then failwithf "child workflows must specify decision task timeout"
          if childWorkflow.ChildPolicy.IsNone then failwithf "child workflows must specify child policy"
  
          workflow.Append(StartChildWorkflow, childWorkflow)
  
      // #endregion
negative.code: open Amazon.SimpleWorkflow.Extensions
  open Amazon.SimpleWorkflow.Extensions.Model
  
  // Marker interface for anything that can be scheduled at a stage of a workflow
  type ISchedulable = 
      abstract member Name        : string
      abstract member Description : string
      abstract member MaxAttempts : int
  
  // Represents an activity
  type IActivity =
      inherit ISchedulable
  
      abstract member TaskList    : TaskList    
      abstract member TaskHeartbeatTimeout        : Seconds
      abstract member TaskScheduleToStartTimeout  : Seconds
      abstract member TaskStartToCloseTimeout     : Seconds
      abstract member TaskScheduleToCloseTimeout  : Seconds
      
      /// Processes a string input and returns the result
      abstract member Process     : string -> string
  
  