dapr / js-sdk

Dapr SDK for Javascript
Apache License 2.0
194 stars 82 forks source link

Workflow example is not working. #549

Closed sce9sc closed 10 months ago

sce9sc commented 10 months ago

Expected Behavior

I run the workflow example but it did not work . The example seems incomplete.

Actual Behavior

components folder is missing and there is not "OrderProcessingWorkflow"

Steps to Reproduce the Problem

run the example as described.

PS One of the best projects I ever found . Thanks

sce9sc commented 10 months ago

After adding components folder and a redis config I got

== APP ==
== APP == > dapr-example-workflow@1.0.0 start
== APP == > npm run build && node dist/index.js
== APP ==
== APP ==
== APP == > dapr-example-workflow@1.0.0 build
== APP == > rimraf ./dist && tsc
== APP ==
== APP == 2023-10-31T19:24:41.609Z INFO [HTTPClient, HTTPClient] Sidecar Started
== APP == 2023-10-31T19:24:51.621Z ERROR [HTTPClient, Workflow] Error starting workflow instance: {"error":"Bad Request","error_msg":"{\"errorCode\":\"ERR_WORKFLOW_COMPONENT_NOT_FOUND\",\"message\":\"workflow component 'dapr' does not exist\"}","status":400}
== APP == Error: {"error":"Bad Request","error_msg":"{\"errorCode\":\"ERR_WORKFLOW_COMPONENT_NOT_FOUND\",\"message\":\"workflow component 'dapr' does not exist\"}","status":400}
== APP ==     at HTTPClient.<anonymous> (C:\Users\Stavros\Documents\work\dapr-workflow\node_modules\@dapr\dapr\implementation\Client\HTTPClient\HTTPClient.js:172:23)
== APP ==     at Generator.next (<anonymous>)
== APP ==     at fulfilled (C:\Users\Stavros\Documents\work\dapr-workflow\node_modules\@dapr\dapr\implementation\Client\HTTPClient\HTTPClient.js:40:58)
== APP ==     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The App process exited with error code: exit status 1

The config I used was

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: state-redis
  namespace: default
spec:
  type: state.redis
  version: v1
  metadata:
  - name: redisHost
    value: localhost:6379
  - name: redisPassword
    value: ""
  - name: actorStateStore
    value: "true"
sce9sc commented 10 months ago

Just realized that there is no server implementation in the example . Seems that is not currently ready and it is expected on version 3.3.0 + . Thanks

shubham1172 commented 10 months ago

Hi @sce9sc, you are right. JS SDK only supports the management plane today, which means you could run a workflow (like https://github.com/Azure/dapr-workflows-aks-sample) independently, and use JS SDK to manage it. We are planning to roll out authoring capabilities in this release too!

shubham1172 commented 10 months ago

Closing this issue as expected!

rzyns commented 3 months ago

Workflow Authoring seems to be supported now (the authoring example works), but there's still no OrderProcessingWorkflow defined in this example (or elsewhere), so it fails to run as written.