temporalio / temporalio/samples-typescript

[Bug] The DSL example seems incorrect

Open
#345 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
465
Forks
148
Avg merge
1d 10h
Merged PRs (30d)
11

Description

What are you really trying to do?

Run our DSL example and verify that it successfully executes the specified sequence of activities.

Describe the bug

There are a few problems with it

  1. Our docs are wrong and mention workflow outputs that don't exist (we return nothing from our workflows)
  2. It doesn't fully execute the DLS specified by the workflowN.yaml file

workflow1.yaml specifies a sequence of three activities that should be executed but we only execute the first two (see reproduction below). The docs also show this: they contain an example output that only shows the first two activities being executed.

workflow2.yaml exhibits the same problem: it runs two sequences in parallel and the final activity of each sequence is not executed. You'll see neither activity3 nor activity5 execute.

Minimal Reproduction

Run workflow1 of the DSL workflow:

# Run worker
$ npm start &
$ npm run workflow1

Worker logs:

<SNIP>
2024-02-23T22:40:13.586Z [INFO] Worker state changed { state: 'RUNNING' }
2024-02-23T22:42:09.274Z [INFO] Executing activity1 {
  isLocal: false,
  attempt: 1,
  namespace: 'default',
  taskToken: 'CiRhM2MyMzFjZi1lZTk5LTQyNTUtOWE4Mi0zMzU5ZDBkOTMxYTESCW15LWRzbC1pZBokMGNlOTE0MjgtNGQwZS00MDA4LTlmNzItZDEwYWI4NWVmYzAyIAUoATIBMUIJYWN0aXZpdHkxSgkIAhDniYABGAE=',
  workflowId: 'my-dsl-id',
  workflowRunId: '0ce91428-4d0e-4008-9f72-d10ab85efc02',
  workflowType: 'DSLInterpreter',
  activityId: '1',
  activityType: 'activity1',
  taskQueue: 'dsl-interpreter',
  arg1: 'value1'
}
2024-02-23T22:42:09.304Z [INFO] Executing activity2 {
  isLocal: false,
  attempt: 1,
  namespace: 'default',
  taskToken: 'CiRhM2MyMzFjZi1lZTk5LTQyNTUtOWE4Mi0zMzU5ZDBkOTMxYTESCW15LWRzbC1pZBokMGNlOTE0MjgtNGQwZS00MDA4LTlmNzItZDEwYWI4NWVmYzAyIAsoATIBMkIJYWN0aXZpdHkySgkIAhD3iYABGAE=',
  workflowId: 'my-dsl-id',
  workflowRunId: '0ce91428-4d0e-4008-9f72-d10ab85efc02',
  workflowType: 'DSLInterpreter',
  activityId: '2',
  activityType: 'activity2',
  taskQueue: 'dsl-interpreter',
  arg: '[result from activity1: value1]'
}

Workflow output:

undefined
Environment/Versions
  • OS and processor: M1 Mac
  • Temporal Version: Server version 1.22.5, SDK version 1.9.1
  • Are you using Docker or Kubernetes or building Temporal from source? I'm building temporal from source

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the documented npm start and npm run workflow1 commands, then inspect workflow1.yaml, workflow2.yaml, and the DSLInterpreter entry point. Verify that all three activities in workflow1 and the final activities in both workflow2 sequences execute, and update the documentation so it no longer reports nonexistent workflow outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.