I am able to setup a service but if I call the service I get error:
== APP == Waiting 30 seconds for instance e40321a6-ed22-4707-80d9-9198d53cd934 to complete...
== APP == Received "Orchestrator Request" work item with instance id 'e40321a6-ed22-4707-80d9-9198d53cd934'
== APP == e40321a6-ed22-4707-80d9-9198d53cd934: Rebuilding local state with 0 history event...
== APP == e40321a6-ed22-4707-80d9-9198d53cd934: Processing 2 new history event(s): [ORCHESTRATORSTARTED=1, EXECUTIONSTARTED=1]
== APP == An orchestrator was returned that doesn't schedule any tasks (type = [object Object])
== APP == e40321a6-ed22-4707-80d9-9198d53cd934: Orchestration completed with status COMPLETED
== APP == e40321a6-ed22-4707-80d9-9198d53cd934: Returning 1 action(s)
If I run the script alone it works but I can the injectable function from the controller it does not see any scheduled task as stated above.
`import {
DaprWorkflowClient,
TWorkflow,
WorkflowActivityContext,
WorkflowContext,
WorkflowRuntime,
} from '@dapr/dapr';
import { Injectable } from '@nestjs/common';
const daprHost = 'localhost'; // Replace with your Dapr host
const daprPort = '50002'; // Replace with your Dapr port
I am able to setup a service but if I call the service I get error:
== APP == Waiting 30 seconds for instance e40321a6-ed22-4707-80d9-9198d53cd934 to complete... == APP == Received "Orchestrator Request" work item with instance id 'e40321a6-ed22-4707-80d9-9198d53cd934' == APP == e40321a6-ed22-4707-80d9-9198d53cd934: Rebuilding local state with 0 history event... == APP == e40321a6-ed22-4707-80d9-9198d53cd934: Processing 2 new history event(s): [ORCHESTRATORSTARTED=1, EXECUTIONSTARTED=1] == APP == An orchestrator was returned that doesn't schedule any tasks (type = [object Object]) == APP == e40321a6-ed22-4707-80d9-9198d53cd934: Orchestration completed with status COMPLETED == APP == e40321a6-ed22-4707-80d9-9198d53cd934: Returning 1 action(s)
If I run the script alone it works but I can the injectable function from the controller it does not see any scheduled task as stated above.
`import { DaprWorkflowClient, TWorkflow, WorkflowActivityContext, WorkflowContext, WorkflowRuntime, } from '@dapr/dapr'; import { Injectable } from '@nestjs/common';
const daprHost = 'localhost'; // Replace with your Dapr host const daprPort = '50002'; // Replace with your Dapr port
@Injectable() export class DaprActivityService { private readonly workflowClient: DaprWorkflowClient; private readonly workflowRuntime: WorkflowRuntime;
constructor() { this.workflowClient = new DaprWorkflowClient({ daprHost, daprPort }); this.workflowRuntime = new WorkflowRuntime({ daprHost, daprPort }); }
async startWorkflow(id: string) { console.log('WorkflowClient:', this.workflowClient); console.log('WorkflowRuntime:', this.workflowRuntime);
} }
const daprService = new DaprActivityService(); daprService.startWorkflow('12345'); `