Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 21, 2025

Documentation and Examples Review - Complete ✅

All Completed Tasks:

  • Getting Started Guide (website/docs/guide/getting-started.md)

    • ✅ Fixed activities to show Future/Result pattern
    • ✅ Updated client example to show Future/Result pattern
    • ✅ Fixed worker setup example
    • ✅ Already uses destructured context
    • ✅ Simplified variable naming (resultFuture -> future)
  • Activity Handlers Guide (website/docs/guide/activity-handlers.md)

    • ✅ Updated all examples to show Future/Result pattern with ActivityError
    • ✅ Fixed dependency injection examples
    • ✅ Updated testability examples
  • Worker Implementation Guide (website/docs/guide/worker-implementation.md)

    • ✅ Added Future/Result pattern to activities examples
    • ✅ Clarified that workflows receive plain values from activities
    • ✅ Updated error handling section with proper ActivityError usage
    • ✅ Fixed worker setup example
    • ✅ Destructured context in all workflow examples
    • ✅ Fixed comment: "activities is fully typed"
  • Worker Usage Guide (website/docs/guide/worker-usage.md)

    • ✅ Removed non-existent createWorker function
    • ✅ Updated to use standard Worker.create
    • ✅ Fixed child workflow examples to show Result pattern
    • ✅ Updated all worker startup examples
    • ✅ Destructured context in all workflow examples
  • Result Pattern Guide (website/docs/guide/result-pattern.md)

    • ✅ Clarified activities use Future/Result internally
    • ✅ Fixed workflow examples to show activities return plain values
    • ✅ Updated benefits section with correct patterns
    • ✅ Child workflow examples remain correct (they do use Result)
    • ✅ Destructured context in all workflow examples
  • Entry Points Guide (website/docs/guide/entry-points.md)

    • ✅ Destructured context in all workflow examples
  • Client Usage Guide (website/docs/guide/client-usage.md)

    • ✅ Fixed examples to show Future/Result pattern from client
    • ✅ Updated startWorkflow to show Result handling
    • ✅ Simplified variable naming (resultFuture -> future)
  • Client README (packages/client/README.md)

    • ✅ Fixed client creation syntax to include Client instance
  • Worker README (packages/worker/README.md)

    • ✅ Added Future/Result pattern to activities example
    • ✅ Removed deprecated createWorker function
    • ✅ Fixed to use standard Worker.create
    • ✅ Destructured context in all workflow examples (including processOrder example)
  • Main README (README.md)

    • ✅ Updated quick example to show Future/Result pattern for activities
  • Sample READMEs

    • ✅ Fixed order-processing-client README references
    • ✅ Updated order-processing-worker README
    • ✅ Removed references to non-existent worker-boxed sample
  • Homepage (website/docs/index.md)

    • ✅ Fixed createWorker references to use Worker.create
    • ✅ Updated client example to show Future/Result pattern
    • ✅ Added proper Connection setup
    • ✅ Already uses destructured context
    • ✅ Simplified variable naming (resultFuture -> future)
  • Formatting

    • ✅ Fixed trailing whitespace issues identified by CI

Summary of Changes

All documentation and README files have been reviewed and updated to reflect the actual code implementation:

  1. Activities always use Future.fromPromise() with .mapError() and .mapOk()
  2. ActivityError is always used to wrap errors in activities
  3. Workflows receive plain values from activities (Result unwrapped by framework)
  4. Workflows destructure context parameter: ({ activities }, input) => {} - ALL instances fixed
  5. Clients receive Future<Result> from workflow execution methods
  6. Child workflows use the Result pattern for explicit error handling
  7. Worker setup uses standard Worker.create() from @temporalio/worker
  8. All examples are now consistent and match the actual implementation
  9. Code formatting has been fixed to pass CI checks
  10. Variable naming simplified (resultFuture -> future) for better readability
Original prompt

review the whole website and every readme, some examples are not up to date with code


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 21, 2025 16:53
- Update Getting Started guide with correct activity implementation patterns
- Fix Activity Handlers guide to show Future/Result pattern
- Update Worker Implementation guide with proper error handling examples
- Correct Result Pattern guide to clarify activities vs workflows
- Fix Client Usage guide to show Future/Result pattern correctly
- Update package READMEs with consistent examples
- Fix main README with proper example

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
- Remove references to non-existent createWorker function
- Update to use standard Worker.create from @temporalio/worker
- Fix child workflow examples to show Result pattern
- Update sample READMEs to reflect actual samples
- Remove references to non-existent worker-boxed sample

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
- Update index.md with correct Worker.create usage
- Fix client example to show Future/Result pattern
- Add proper Connection setup in client example
- Ensure all worker examples use standard Temporal Worker API

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
Copilot AI changed the title [WIP] Review website and README files for code consistency docs: align examples with actual Future/Result implementation patterns Dec 21, 2025
Copilot AI requested a review from btravers December 21, 2025 16:59
Changed all workflow implementations from:
  implementation: async (context, input) => {}
to:
  implementation: async ({ activities, executeChildWorkflow, ... }, input) => {}

This follows the codebase convention of destructuring the context parameter directly.

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
Copilot AI requested a review from btravers December 21, 2025 17:07
@btravers btravers marked this pull request as ready for review December 21, 2025 17:09
Copilot AI review requested due to automatic review settings December 21, 2025 17:09
@btravers
Copy link
Owner

@copilot format because CI is KO

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
@btravers
Copy link
Owner

@copilot retry

Run oxfmt to fix CI formatting issues.

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 21, 2025

@copilot retry

Formatting fixed in c9bd000. Ran oxfmt to remove trailing whitespace that was causing CI to fail.

Updated packages/worker/README.md to use destructured context parameter pattern:
- Changed from: implementation: async (context, input) => {}
- Changed to: implementation: async ({ activities }, input) => {}

This ensures consistency across all documentation examples.

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates all documentation and README files to accurately reflect the current codebase implementation, specifically around the Result/Future pattern usage, worker creation, and context destructuring.

Key Changes:

  • Updated all activity examples to show the Future.fromPromise() pattern with ActivityError wrapping
  • Fixed worker creation examples to use standard Worker.create() instead of the non-existent createWorker function
  • Updated workflow implementations to destructure context parameters
  • Clarified that workflows receive plain values from activities (Result unwrapped by framework) while child workflows use the Result pattern

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/docs/index.md Updated client and worker examples to show Result/Future pattern and correct Worker.create usage
website/docs/guide/worker-usage.md Removed createWorker references, updated child workflow examples to show Result pattern
website/docs/guide/worker-implementation.md Added Future/Result pattern to activities, clarified workflow receives plain values, destructured context
website/docs/guide/result-pattern.md Clarified activities use Future/Result internally while workflows use try/catch for activity calls
website/docs/guide/getting-started.md Fixed worker setup and client examples to show Result/Future pattern
website/docs/guide/entry-points.md Destructured context in workflow examples
website/docs/guide/client-usage.md Updated to show Future/Result pattern from client perspective
website/docs/guide/activity-handlers.md Updated all activity examples to show Future/Result pattern with ActivityError
samples/order-processing-worker/README.md Updated description to reflect Result/Future pattern usage
samples/order-processing-client/README.md Fixed references to non-existent worker-boxed sample, updated to worker-nestjs
packages/worker/README.md Added Future/Result pattern to activities, removed createWorker, destructured context
packages/client/README.md Fixed client creation to include Client instance
README.md Updated quick example to show Future/Result pattern for activities
Comments suppressed due to low confidence (1)

website/docs/guide/worker-usage.md:1

  • The variable name 'handleResult' is confusing as it suggests a result when it actually contains a Result wrapping a workflow handle. Consider naming it 'handleOrError' or 'startResult' to better reflect that it's the result of starting (not the workflow result).
# Worker Usage

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changed variable name from 'resultFuture' to 'future' across all documentation to avoid redundancy since it's already clear from context that it's a Future.

Updated files:
- website/docs/index.md (2 instances)
- website/docs/guide/getting-started.md
- website/docs/guide/client-usage.md

Co-authored-by: btravers <3476441+btravers@users.noreply.github.com>
Copilot AI requested a review from btravers December 21, 2025 18:07
@btravers btravers enabled auto-merge (squash) December 21, 2025 18:11
@btravers btravers merged commit f634a9d into main Dec 21, 2025
11 checks passed
@btravers btravers deleted the copilot/review-website-readmes branch December 21, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants