You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -38,31 +38,159 @@ Workflows GraphQL datasets require an `accountTag` filter with your Cloudflare a
38
38
39
39
### Examples
40
40
41
-
To query the sum of `readQueries`, `writeQueries`for a given `$databaseId`, grouping by `databaseId` and `date`:
41
+
To query the count (number of workflow invocations) and sum of `wallTime`for a given `$workflowName` between `$datetimeStart` and`$datetimeEnd`, grouping by`date`:
42
42
43
43
```graphql
44
-
query {
45
-
viewer {
46
-
accounts(filter: { accountTag: $accountId }) {
47
-
d1AnalyticsAdaptiveGroups(
48
-
limit: 10000
49
-
filter: {
50
-
date_geq: $startDate
51
-
date_leq: $endDate
52
-
databaseId: $databaseId
53
-
}
54
-
orderBy: [date_DESC]
55
-
) {
56
-
sum {
57
-
readQueries
58
-
writeQueries
59
-
}
60
-
dimensions {
61
-
date
62
-
databaseId
63
-
}
64
-
}
65
-
}
66
-
}
44
+
{
45
+
viewer {
46
+
accounts(filter: { accountTag: $accountTag }) {
47
+
wallTime: workflowsAdaptiveGroups(
48
+
limit: 10000
49
+
filter: {
50
+
datetimeHour_geq: $datetimeStart,
51
+
datetimeHour_leq: $datetimeEnd,
52
+
workflowName: $workflowName
53
+
}
54
+
orderBy: [count_DESC]
55
+
) {
56
+
count
57
+
sum {
58
+
wallTime
59
+
}
60
+
dimensions {
61
+
date: datetimeHour
62
+
}
63
+
}
64
+
}
65
+
}
67
66
}
68
67
```
68
+
69
+
Here we are doing the same for `wallTime`, `instanceRuns` and `stepCount` in the same query:
70
+
71
+
```graphql
72
+
{
73
+
viewer {
74
+
accounts(filter: { accountTag: $accountTag }) {
75
+
instanceRuns: workflowsAdaptiveGroups(
76
+
limit: 10000
77
+
filter: {
78
+
datetimeHour_geq: $datetimeStart
79
+
datetimeHour_leq: $datetimeEnd
80
+
workflowName: $workflowName
81
+
eventType: "WORKFLOW_START"
82
+
}
83
+
orderBy: [count_DESC]
84
+
) {
85
+
count
86
+
dimensions {
87
+
date: datetimeHour
88
+
}
89
+
}
90
+
stepCount: workflowsAdaptiveGroups(
91
+
limit: 10000
92
+
filter: {
93
+
datetimeHour_geq: $datetimeStart
94
+
datetimeHour_leq: $datetimeEnd
95
+
workflowName: $workflowName
96
+
eventType: "STEP_START"
97
+
}
98
+
orderBy: [count_DESC]
99
+
) {
100
+
count
101
+
dimensions {
102
+
date: datetimeHour
103
+
}
104
+
}
105
+
wallTime: workflowsAdaptiveGroups(
106
+
limit: 10000
107
+
filter: {
108
+
datetimeHour_geq: $datetimeStart
109
+
datetimeHour_leq: $datetimeEnd
110
+
workflowName: $workflowName
111
+
}
112
+
orderBy: [count_DESC]
113
+
) {
114
+
count
115
+
sum {
116
+
wallTime
117
+
}
118
+
dimensions {
119
+
date: datetimeHour
120
+
}
121
+
}
122
+
}
123
+
}
124
+
}
125
+
```
126
+
127
+
Here lets query `workflowsAdaptive` for raw data about `$instanceId` between `$datetimeStart` and `$datetimeEnd`:
As said above, you can use [introspection](/analytics/graphql-api/features/discovery/introspection/) with your favorite GraphQL client to discover the available fields and types of the Workflows datasets, but here are some of our `workflowsAdaptiveGroups` dimensions:
170
+
171
+
* date - The date when trigger was triggered
172
+
* datetimeFifteenMinutes - The date and time truncated to fifteen minutes
173
+
* datetimeFiveMinutes - The date and time truncated to five minutes
174
+
* datetimeHour - The date and time truncated to the hour
175
+
* datetimeMinute - The date and time truncated to the minute
176
+
* eventType - Event type
177
+
* instanceId - Instance Id
178
+
* stepCount - Step number
179
+
* stepName - Step name
180
+
* workflowName - Workflow Name
181
+
182
+
And here's a list of `eventType`s you can filter on:
0 commit comments