How to filter all the workflow runs that are in running state using logic managment client class and workflowRuns function

vivek singh 1 Reputation point

I am trying to get the top n workflow runs that has status marked as Running. I am using below mentioned function to fetch the details using azure/arm-logic module in Typescript, but due to some reason status filter is not working I am fetching all the runs irrespective of there status. Please help me to resolve this issue. I looked into the documentation but not able to debug it. Function not throwing any kind of error but its also not fetching right data.

function isProcessorRunning() {  
    return new Promise((resolve, reject) => {  
        const client = new LogicManagementClient(new DefaultAzureCredential(), subscriptionId);  
        const workflow =  client.workflowRuns;  
        const data = workflow.list(Resource_group_name, workflow_name, filter = {"status" : "Running"});  
                             if(data.value.status == 'Running');  
                         }).catch(err =>{  

Please find these link for reference -

WorkflowRunsListOptionalParams interface -

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,544 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 63,511 Reputation points

    @vivek singh Thanks for reaching out and apology for the delay. I believe you might have already resolved the issue. But in case you haven't found the solution and for the community facing the same issue posting the resolution for your issue.

    As you have already shared the document the filter should be of type string as mentioned here. The filter should have the ODATA query as below. For supported filter status values you can refer to this.

      const data = workflow.list(Resource_group_name, workflow_name, { filter: "status eq 'Failed'"});  

    Let me know if you are still facing the issue.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments