-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Describe the bug
When calling durableClient.getStatus(<instanceId>, { showHistory: true })
, history
is not returned on response. While debugging, DurableOrchestarationStatus
's constructor does:
// init.history does not exist on init but historyEvents does and contains the history data
this.history = init.history
Investigative information
- Durable Functions extension version: 1.16.1
- durable-functions npm module version: 3.1.0
- Language (JavaScript/TypeScript) and version: typescript 4.9.5
- Node.js version: 20.17.0
Additional:
- Azure Functions Core Tools: 4.0.5801
- Azure Runtime Version: 4.34.1.22669
If deployed to Azure App Service
- Timeframe issue observed: N/A
- Function App name: N/A
- Function name(s): N/A
- Region: N/A
- Orchestration instance ID(s): N/A
If you don't want to share your Function App name or Functions names on GitHub, please be sure to provide your Invocation ID, Timestamp, and Region - we can use this to look up your Function App/Function. Provide an invocation id per Function. See the Functions Host wiki for more details.
To Reproduce
- VSCode + Function App VSCode extension + Azurite (Official setup docs)
- F1 > Azure Functions: Create Function > Durable Functions orchestrator > Give it a name (Ex: "Test")
- Orchestrator code should be Microsoft's example boilerplate code. The output of the durable function orchestration should be:
{
"name": "helloOrchestrator",
"instanceId": "6ba3f77933b1461ea1a3828c013c9d56",
"runtimeStatus": "Completed",
"input": "",
"customStatus": null,
"output": [
"Hello, Tokyo",
"Hello, Seattle",
"Hello, Cairo"
],
"createdTime": "2023-02-13T23:02:21Z",
"lastUpdatedTime": "2023-02-13T23:02:25Z"
}
- F1 > Azure Functions: Create Function > HTTP trigger > Give it a name (Ex: GetOrchestrationStatus)
- In
GetOrchestrationStatus.ts
(function made on step 5), copy-paste:
import { app, HttpRequest, HttpResponseInit, InvocationContext } from '@azure/functions';
import { getClient, input } from 'durable-functions';
export async function GetOrchestrationStatus(request: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> {
const { instanceId } = request.params;
const client = getClient(context);
const instance = await client.getStatus(instanceId, { showHistory: true });
return { jsonBody: instance, status: 200 };
}
app.http('GetOrchestrationStatus', {
route: ínstances/{instanceId},
methods: ['GET','POST'],
authLevel: 'anonymous',
extraInputs: [input.durableClient()],
handler: GetOrchestrationStatus
});
local.settings.json
:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node"
}
}
- Hit
F5
to run and debug - Put a breakpoint on the return line on
GetOrchestrationStatus
- Run an orchestration by using some tool like Yaak Ex:
http://localhost:7071/api/orchestrators/TestOrchestrator
- Copy the orchestration instance ID (
id
on response) - Now call the
GetOrchestrationStatus
Azure function:http://localhost:7071/api/instances/<id you just copied>
- Response from call from step 12 does not have the
history
key with events
Expected behavior
A clear and concise description of what you expected to happen.
durableClient.getStatus(instanceId, { showHistory: true })
return value has a history
key and data.
Actual behavior
A clear and concise description of what actually happened.
durableClient.getStatus(instanceId, { showHistory: true })
return value does not return a history
key nor data.
Screenshots
If applicable, add screenshots to help explain your problem.

Known workarounds
Provide a description of any known workarounds you used.
Directly modify node_modules/durable-functions/lib/src/orchestrations/DurableOrchestrationStatus.js
's constructor:
- this.history = init.history
+ this.history = init.historyEvents
- Not recommended to modify node_modules
- On package update, directory delete, or node_modules delete, changes will be eliminated
Additional context
- Development environment (ex. Visual Studio)
- Links to source
- Additional bindings used
- Function invocation IDs