Skip to content

Conversation

@jjcollinge
Copy link
Contributor

@jjcollinge jjcollinge commented Sep 5, 2025

Signed-off-by: Jonathan Collinge [email protected]

Description

Adds a simple command to fetch a specific workflow history execution given an app id and instance id. It does this by using the actor state store directly to fetch and compile the state.

TODO: Wrap the history objects in a top level object.

dapr workflow get-history --app-id test --instance-id 22e7f013-6bca-4b36-8474-23e15c97af75

dapr client initializing for: 127.0.0.1:50001
{
  "eventId": -1,
  "timestamp": "2025-09-05T13:17:20.046821632Z",
  "orchestratorStarted": {}
}
{
  "eventId": -1,
  "timestamp": "2025-09-05T13:17:20.030790298Z",
  "executionStarted": {
    "name": "SimpleWorkflow",
    "orchestrationInstance": {
      "instanceId": "56a4e807-5b5e-4aff-aefa-e8c4deb5ecef",
      "executionId": "857556f5-8b84-4289-bb47-b5b8a97c53a1"
    }
  },
  "router": {
    "sourceAppID": "performance-app"
  }
}
{
  "timestamp": "2025-09-05T13:17:20.048880840Z",
  "taskScheduled": {
    "name": "TenMSActivity",
    "input": "{\"name\":\"John\"}",
    "taskExecutionId": "4683256b-0495-4f2b-9bb0-84c33f4bf613"
  },
  "router": {
    "sourceAppID": "performance-app"
  }
}
{
  "eventId": -1,
  "timestamp": "2025-09-05T13:17:20.063432465Z",
  "orchestratorStarted": {}
}
{
  "eventId": -1,
  "timestamp": "2025-09-05T13:17:20.060736465Z",
  "taskCompleted": {
    "result": "{\"startTime\":\"2025-09-05T13:17:20.054144965Z\",\"endTime\":\"2025-09-05T13:17:20.060429965Z\",\"success\":true,\"message\":\"Hello John!\"}",
    "taskExecutionId": "4683256b-0495-4f2b-9bb0-84c33f4bf613"
  },
  "router": {
    "sourceAppID": "performance-app"
  }
}
{
  "eventId": 1,
  "timestamp": "2025-09-05T13:17:20.064046882Z",
  "executionCompleted": {
    "orchestrationStatus": "ORCHESTRATION_STATUS_COMPLETED",
    "result": "{\"success\":true,\"activityHistory\":[{\"activityName\":\"SayHelloWorldActivity3\",\"activityType\":\"activity\",\"startTime\":\"2025-09-05T13:17:20.054144965Z\",\"endTime\":\"2025-09-05T13:17:20.060429965Z\"}]}"
  },
  "router": {
    "sourceAppID": "performance-app"
  }
}

We could easily expand the dapr workflow command to support the following actions based on the go-sdk:

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@jjcollinge jjcollinge requested review from a team as code owners September 5, 2025 12:00
@JoshVanL
Copy link
Contributor

JoshVanL commented Sep 5, 2025

@jjcollinge please open a PR for the docs

JoshVanL
JoshVanL previously approved these changes Sep 5, 2025
@jjcollinge
Copy link
Contributor Author

Will do, also going to make the output valid JSON.

@JoshVanL JoshVanL changed the base branch from master to release-1.16 September 12, 2025 17:44
@JoshVanL JoshVanL force-pushed the jjcollinge/cmd-workflow-get-history branch from 93f416d to d87e985 Compare September 12, 2025 17:48
Signed-off-by: joshvanl <[email protected]>
@dapr-bot
Copy link
Collaborator

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@dapr-bot dapr-bot added the stale label Oct 12, 2025
@dapr-bot
Copy link
Collaborator

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@dapr-bot dapr-bot closed this Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants