Code Monkey home page Code Monkey logo

Comments (8)

kanupriya15025 avatar kanupriya15025 commented on June 1, 2024

@kaibocai Do you have any ETA on this?

from durabletask-java.

kaibocai avatar kaibocai commented on June 1, 2024

Hi @kanupriya15025 , sorry for the delay. Based on my research, I don't think we currently support querying status while the orchestration is still running. This may be an improvement we can add in the future.
@cgillum, @davidmrdavid have you ever gotten customers asking for a feature like this?

from durabletask-java.

cgillum avatar cgillum commented on June 1, 2024

I know there's a showHistory flag which returns the history of what is happening with my orchestration, but I want to store some custom activity status messages after each completion.

We don't have the ability to store custom status for activity results, unfortunately. Just the activity output. I'm not sure if it makes sense for this to be a feature of Durable Functions, or if it's better to do that in some external storage.

The output is returned in the API once the entire orchestration completes, but I need to get partial statuses even if the orchestration is running. Is there a way to achieve that?

It should be possible to query orchestration history even when the orchestration is still running. Is that not the case from what you're seeing?

from durabletask-java.

kanupriya15025 avatar kanupriya15025 commented on June 1, 2024

@cgillum @kaibocai
By custom status, I meant the task output itself. In a case, where an activity takes too long to complete due to some error, the entire output of previous tasks is stalled in that case.
It is possible to query history table but querying the history can be slow as it is huge. If this can be embedded as a response in the /instances API, it would make it quicker, easier and more intuitive.

from durabletask-java.

cgillum avatar cgillum commented on June 1, 2024

In a case, where an activity takes too long to complete due to some error, the entire output of previous tasks is stalled in that case.

You should be able to get the output of previously completed tasks of a running orchestration already. Can you provide an example of where this is not the case for you?

It is possible to query history table but querying the history can be slow as it is huge. If this can be embedded as a response in the /instances API, it would make it quicker, easier and more intuitive.

This is already possible with the HTTP API: https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-http-api#get-instance-status. Something like this should work:

GET /runtime/webhooks/durabletask/instances/abc123?showHistory=true&showHistoryOutput=true
Field Parameter type Description
showHistory Query string Optional parameter. If set to true, the orchestration execution history will be included in the response payload.
showHistoryOutput Query string Optional parameter. If set to true, the function outputs will be included in the orchestration execution history.

from durabletask-java.

kanupriya15025 avatar kanupriya15025 commented on June 1, 2024

@cgillum Is this the field you are aiming at - "output"?
Here's a response where I can see a few activities completed but the output is still null. This only populates when all the activities complete.

{
  "name": "WorkflowOrchestrator",
  "instanceId": "instanceId",
  "runtimeStatus": "Running",
  "input": {
    "input" : "someInput"
  },
  "customStatus": "",
  "output": null,
  "createdTime": "2023-10-05T08:20:14Z",
  "lastUpdatedTime": "2023-10-05T08:20:35Z",
  "historyEvents": [
    {
      "EventType": "ExecutionStarted",
      "Input": "SomeInput,
      "Correlation": null,
      "ScheduledStartTime": null,
      "Generation": 0,
      "Timestamp": "2023-10-05T08:20:14.576414Z",
      "FunctionName": "WorkflowOrchestrator"
    },
    {
      "EventType": "TaskCompleted",
      "Result": "{\"testTask1\":{\"startDate\":\"2023-10-05T08:20:17.399572\",\"firstTask\":{\"status_code\":500,\"reason\":\"Internal Server Error\",\"headers\":\"[Lorg.apache.http.Header;@33ad2eb2\",\"body\":\"org.apache.http.impl.io.EmptyInputStream@180fb89\"},\"state\":\"SUCCESS\",\"endDate\":\"2023-10-05T08:20:18.583269\"}}",
      "Timestamp": "2023-10-05T08:20:18.843449Z",
      "ScheduledTime": "2023-10-05T13:50:16.908051+05:30",
      "FunctionName": "AEPHTTPPollingOperator",
      "Input": null
    },
    {
      "EventType": "TimerCreated",
      "FireAt": "2023-10-05T08:20:24.893Z",
      "Timestamp": "2023-10-05T08:20:19.919621Z"
    },
    {
      "EventType": "TimerFired",
      "FireAt": "2023-10-05T08:20:24.893Z",
      "Timestamp": "2023-10-05T08:20:19.919683Z"
    },
    {
      "EventType": "TaskCompleted",
      "Result": "{\"testTask1\":{\"startDate\":\"2023-10-05T08:20:17.399572\",\"firstTask\":{\"status_code\":500,\"reason\":\"Internal Server Error\",\"headers\":\"[Lorg.apache.http.Header;@33ad2eb2\",\"body\":\"org.apache.http.impl.io.EmptyInputStream@180fb89\"},\"state\":\"SUCCESS\",\"endDate\":\"2023-10-05T08:20:18.583269\"},\"testTask2\":{\"startDate\":\"2023-10-05T08:20:26.186607\",\"firstTask\":{\"status_code\":500,\"reason\":\"Internal Server Error\",\"headers\":\"[Lorg.apache.http.Header;@6526546a\",\"body\":\"org.apache.http.impl.io.EmptyInputStream@180fb89\"},\"state\":\"SUCCESS\",\"endDate\":\"2023-10-05T08:20:27.304066\"}}",
      "Timestamp": "2023-10-05T08:20:28.005728Z",
      "ScheduledTime": "2023-10-05T13:50:25.686154+05:30",
      "FunctionName": "AEPHTTPPollingOperator",
      "Input": null
    },
    {
      "EventType": "TimerCreated",
      "FireAt": "2023-10-05T08:20:34.153Z",
      "Timestamp": "2023-10-05T08:20:29.186666Z"
    },
    {
      "EventType": "TimerFired",
      "FireAt": "2023-10-05T08:20:34.153Z",
      "Timestamp": "2023-10-05T08:20:29.186671Z"
    },
    {
      "EventType": "TaskScheduled",
      "Name": "AEPHTTPPollingOperator",
      "Input": null,
      "Timestamp": "2023-10-05T08:20:35.579164Z"
    }
  ]
}

from durabletask-java.

cgillum avatar cgillum commented on June 1, 2024

@kanupriya15025 I'm able to see the activity output in the Result properties of the TaskCompleted events:

    {
      "EventType": "TaskCompleted",
      "Result": "{\"testTask1\":{\"startDate\":\"2023-10-05T08:20:17.399572\",\"firstTask\":{\"status_code\":500,\"reason\":\"Internal Server Error\",\"headers\":\"[Lorg.apache.http.Header;@33ad2eb2\",\"body\":\"org.apache.http.impl.io.EmptyInputStream@180fb89\"},\"state\":\"SUCCESS\",\"endDate\":\"2023-10-05T08:20:18.583269\"}}",
      "Timestamp": "2023-10-05T08:20:18.843449Z",
      "ScheduledTime": "2023-10-05T13:50:16.908051+05:30",
      "FunctionName": "AEPHTTPPollingOperator",
      "Input": null
    },
...
    {
      "EventType": "TaskCompleted",
      "Result": "{\"testTask1\":{\"startDate\":\"2023-10-05T08:20:17.399572\",\"firstTask\":{\"status_code\":500,\"reason\":\"Internal Server Error\",\"headers\":\"[Lorg.apache.http.Header;@33ad2eb2\",\"body\":\"org.apache.http.impl.io.EmptyInputStream@180fb89\"},\"state\":\"SUCCESS\",\"endDate\":\"2023-10-05T08:20:18.583269\"},\"testTask2\":{\"startDate\":\"2023-10-05T08:20:26.186607\",\"firstTask\":{\"status_code\":500,\"reason\":\"Internal Server Error\",\"headers\":\"[Lorg.apache.http.Header;@6526546a\",\"body\":\"org.apache.http.impl.io.EmptyInputStream@180fb89\"},\"state\":\"SUCCESS\",\"endDate\":\"2023-10-05T08:20:27.304066\"}}",
      "Timestamp": "2023-10-05T08:20:28.005728Z",
      "ScheduledTime": "2023-10-05T13:50:25.686154+05:30",
      "FunctionName": "AEPHTTPPollingOperator",
      "Input": null
    },

from durabletask-java.

microsoft-github-policy-service avatar microsoft-github-policy-service commented on June 1, 2024

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

from durabletask-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.