0

List Suspended Jobs

by
Published Jan 3, 2023

List jobs suspended on an approval or a sleep step, optionally only those of one flow path.

Script windmill Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 14 days ago
1
//native
2

3
import * as wmill from "windmill-client"
4

5
// windmill-client errors only carry the status text: throw the response body, which says why
6
wmill.OpenAPI.interceptors.response.use(async (response) => {
7
  if (!response.ok) {
8
    throw new Error(`${response.status} ${await response.text()}`)
9
  }
10
  return response
11
})
12

13
/**
14
 * List Suspended Jobs
15
 * List jobs suspended on an approval or a sleep step, optionally only those of one flow path.
16
 */
17
export async function main(
18
  script_path_exact: string | undefined,
19
  per_page: number | undefined
20
) {
21
  return await wmill.JobService.listQueue({
22
    workspace: wmill.getWorkspace(),
23
    suspended: true,
24
    scriptPathExact: script_path_exact || undefined,
25
    perPage: per_page ?? undefined,
26
  })
27
}
28

Other submissions
  • Submitted by admin Deno
    Created 540 days ago
    1
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    2
    
    
    3
    export async function main(scriptPathExact?: string) {
    4
      return wmill.JobService.listQueue({
    5
        workspace: wmill.getWorkspace(),
    6
        suspend: true,
    7
        perPage: 50,
    8
        scriptPathExact,
    9
      });
    10
    }
    11