Skip to content

Use named object inputs and results in TypeScript samples - #543

Open
mjameswh wants to merge 1 commit into
mainfrom
single-object-sample-arguments
Open

mjameswh wants to merge 1 commit into
mainfrom
single-object-sample-arguments

Conversation

@mjameswh

Copy link
Copy Markdown
Contributor

Summary

  • Give sample Workflows, Activities, Signals, Queries, and Updates a single named object input when they need input, and a named object result when they return a value. Keep the introductory hello-world and hello-world-js samples simple; keep parameterless and void handlers as-is.
  • Update clients, child Workflows, Continue-As-New calls, Nexus handlers, CLI examples, and test doubles alongside the definitions. The DSL now maps input field names to bindings or literal strings.
  • Document the convention under Contributing → Sample best practices.

These changes alter serialized payloads. Run the updated samples with fresh executions; this is not a migration for existing histories.

Validation

  • pnpm build and pnpm lint, including targeted checks for the changed nested samples; scratchpad also passed tsc --noEmit.
  • Filtered Temporal sample tests and targeted reruns after the output changes, including OpenAI Agents (43 tests), Google ADK, Strands, Vercel AI SDK, LangSmith, message passing, Nexus serialization, timer, mutex, standalone Activity, polling, and Workflow Streams.
  • Local Temporal smoke tests covered named results for the custom-logger Activity, child Workflows, state Queries, and fetchAndAdd, plus both bundled DSL YAML examples.
  • The broader recursive run encountered a missing Jest watch plugin in the unchanged monorepo-folders frontend. Changed sample files passed Prettier; the broader format check flagged generated coverage and pre-existing polling formatting.

Docs follow-up

80 Snipsync snippets changed in place; no IDs were renamed. Review companion examples and prose in Temporal Docs and Temporal Learning for positional arguments, scalar CLI payloads, old DSL syntax, and direct reads of scalar results. Those repositories were not changed.

Affected Snipsync IDs
typescript-activity-cancellable-fetch
typescript-activity-complete-async
typescript-activity-fake-progress
typescript-activity-fn
typescript-activity-use-injected-logger
typescript-activity-with-deps
typescript-blocked-workflow
typescript-cancel-requested-with-non-cancellable
typescript-child-workflow
typescript-continue-as-new-workflow
typescript-create-a-scheduled-workflow
typescript-define-query
typescript-empty-client
typescript-encryption-client
typescript-encryption-codec
typescript-encryption-workflow
typescript-esm-client
typescript-esm-workflow
typescript-handle-external-workflow-cancellation-while-activity-running
typescript-handle-query
typescript-lambda-worker-workflow
typescript-langsmith-activity
typescript-langsmith-agent-pipeline
typescript-langsmith-handlers
typescript-langsmith-workflow
typescript-logger-sink-workflow
typescript-message-passing-introduction
typescript-multiple-activities-single-timeout-workflow
typescript-nexus-hello-caller-workflow
typescript-non-cancellable-shields-children
typescript-oneclick-buy
typescript-openai-agents-activity-tool-workflow
typescript-openai-agents-agent-as-tool-workflow
typescript-openai-agents-approval-workflow
typescript-openai-agents-hello-world-workflow
typescript-openai-agents-hosted-tool-workflow
typescript-openai-agents-inline-tool-workflow
typescript-openai-agents-nexus-tool-workflow
typescript-openai-agents-sandboxes-workflow
typescript-openai-agents-session-carryover-workflow
typescript-openai-agents-session-workflow
typescript-openai-agents-stateful-mcp-workflow
typescript-openai-agents-stateless-mcp-workflow
typescript-openai-agents-streaming-workflow
typescript-polling-infrequent
typescript-send-query
typescript-shared-promise-scopes
typescript-shield-awaited-in-root-scope
typescript-sleep-for-days
typescript-sleep-for-days-client
typescript-standalone-activity-definition
typescript-standalone-activity-get-handle
typescript-standalone-activity-result
typescript-standalone-activity-start
typescript-sticky-queues-workflow
typescript-strands-activity-interrupt-activity
typescript-strands-activity-interrupt-workflow
typescript-strands-continue-as-new-workflow
typescript-strands-hello-world-client
typescript-strands-hello-world-workflow
typescript-strands-hooks-activity
typescript-strands-hooks-workflow
typescript-strands-human-in-the-loop-workflow
typescript-strands-mcp-workflow
typescript-strands-streaming-client
typescript-strands-streaming-workflow
typescript-strands-structured-output-workflow
typescript-strands-tools-activity
typescript-strands-tools-workflow
typescript-timer-reminder-workflow
typescript-updatable-timer-impl
typescript-update-client
typescript-update-workflow
typescript-vercel-ai-sdk-haiku-agent
typescript-vercel-ai-sdk-mcp-agent
typescript-vercel-ai-sdk-middleware-agent
typescript-vercel-ai-sdk-streaming-agent
typescript-vercel-ai-sdk-tools-agent
typescript-vercel-ai-sdk-weather-activity
typescript-workflow-type

Update sample handlers and all their callers together, including child starts, Continue-As-New, message passing, CLI payloads, and test doubles. Preserve Snipsync IDs and keep the introductory Hello World samples simple.
@mjameswh
mjameswh requested review from a team as code owners November 27, 2026 20:59
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.

1 participant