diff --git a/_examples/callback/callback.go b/_examples/callback/callback.go index 78b95e1..1c53f27 100644 --- a/_examples/callback/callback.go +++ b/_examples/callback/callback.go @@ -50,7 +50,7 @@ type Deps struct { func ExampleWorkflow(d Deps) *workflow.Workflow[Example, Status] { b := workflow.NewBuilder[Example, Status]("callback example") - b.AddCallback(StatusStarted, func(ctx context.Context, r *workflow.Record[Example, Status], reader io.Reader) (Status, error) { + b.AddCallback(StatusStarted, func(ctx context.Context, r *workflow.Run[Example, Status], reader io.Reader) (Status, error) { b, err := io.ReadAll(reader) if err != nil { return 0, err diff --git a/_examples/connector/connector.go b/_examples/connector/connector.go index a8de7ba..ab331fc 100644 --- a/_examples/connector/connector.go +++ b/_examples/connector/connector.go @@ -63,7 +63,7 @@ func Workflow(d Deps) *workflow.Workflow[GettingStarted, Status] { ) builder.AddStep(StatusStarted, - func(ctx context.Context, r *workflow.Record[GettingStarted, Status]) (Status, error) { + func(ctx context.Context, r *workflow.Run[GettingStarted, Status]) (Status, error) { r.Object.FollowAnExample = "✅" return StatusFollowedTheExample, nil diff --git a/_examples/gettingstarted/gettingstarted.go b/_examples/gettingstarted/gettingstarted.go index 7c69f5b..e9d5401 100644 --- a/_examples/gettingstarted/gettingstarted.go +++ b/_examples/gettingstarted/gettingstarted.go @@ -47,17 +47,17 @@ type Deps struct { func Workflow(d Deps) *workflow.Workflow[GettingStarted, Status] { b := workflow.NewBuilder[GettingStarted, Status]("getting started") - b.AddStep(StatusStarted, func(ctx context.Context, r *workflow.Record[GettingStarted, Status]) (Status, error) { + b.AddStep(StatusStarted, func(ctx context.Context, r *workflow.Run[GettingStarted, Status]) (Status, error) { r.Object.ReadTheDocs = "✅" return StatusReadTheDocs, nil }, StatusReadTheDocs) - b.AddStep(StatusReadTheDocs, func(ctx context.Context, r *workflow.Record[GettingStarted, Status]) (Status, error) { + b.AddStep(StatusReadTheDocs, func(ctx context.Context, r *workflow.Run[GettingStarted, Status]) (Status, error) { r.Object.FollowAnExample = "✅" return StatusFollowedTheExample, nil }, StatusFollowedTheExample) - b.AddStep(StatusFollowedTheExample, func(ctx context.Context, r *workflow.Record[GettingStarted, Status]) (Status, error) { + b.AddStep(StatusFollowedTheExample, func(ctx context.Context, r *workflow.Run[GettingStarted, Status]) (Status, error) { r.Object.CreateAFunExample = "✅" return StatusCreatedAFunExample, nil }, StatusCreatedAFunExample) diff --git a/_examples/schedule/schedule.go b/_examples/schedule/schedule.go index ed934d0..bad7ea4 100644 --- a/_examples/schedule/schedule.go +++ b/_examples/schedule/schedule.go @@ -54,7 +54,7 @@ func ExampleWorkflow(d Deps) *workflow.Workflow[Example, Status] { b := workflow.NewBuilder[Example, Status]("schedule trigger example") b.AddStep(StatusStarted, - func(ctx context.Context, r *workflow.Record[Example, Status]) (Status, error) { + func(ctx context.Context, r *workflow.Run[Example, Status]) (Status, error) { return StatusFollowedTheExample, nil }, StatusFollowedTheExample, diff --git a/_examples/timeout/timeout.go b/_examples/timeout/timeout.go index bb89100..cac6c5b 100644 --- a/_examples/timeout/timeout.go +++ b/_examples/timeout/timeout.go @@ -55,11 +55,11 @@ func ExampleWorkflow(d Deps) *workflow.Workflow[Example, Status] { b := workflow.NewBuilder[Example, Status]("timeout example") b.AddTimeout(StatusStarted, - func(ctx context.Context, r *workflow.Record[Example, Status], now time.Time) (time.Time, error) { + func(ctx context.Context, r *workflow.Run[Example, Status], now time.Time) (time.Time, error) { // Using "now" over time.Now() allows for you to specify a clock for testing. return now.Add(time.Hour), nil }, - func(ctx context.Context, r *workflow.Record[Example, Status], now time.Time) (Status, error) { + func(ctx context.Context, r *workflow.Run[Example, Status], now time.Time) (Status, error) { r.Object.Now = now return StatusFollowedTheExample, nil },