Created
August 24, 2023 18:26
-
-
Save WouterNieuwerth/5a1aafe47ff6da0e23bedc8463fd48a7 to your computer and use it in GitHub Desktop.
Google Workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main: | |
params: [event] | |
steps: | |
- init: | |
assign: | |
- parent: projects/[your-project]/locations/europe-west4/repositories/[your-repo] | |
- extract_tableId_step1: '${json.decode(base64.decode(event.data.message.data))}' | |
- extract_tableId_step2: '${extract_tableId_step1.protoPayload.metadata.tableCreation.table.tableName}' | |
- extract_tableId_step3: '${text.split(extract_tableId_step2, "/")}' | |
- extract_tableId_step4: '${extract_tableId_step3[len(extract_tableId_step3) -1]}' | |
- log: | |
call: sys.log | |
args: | |
text: ${extract_tableId_step4} | |
- createCompilationResult: | |
call: http.post | |
args: | |
url: ${"https://dataform.googleapis.com/v1beta1/" + parent + "/compilationResults"} | |
auth: | |
type: OAuth2 | |
body: | |
gitCommitish: main | |
code_compilation_config: | |
vars: | |
GA4_TABLE: ${extract_tableId_step4} | |
result: compilationResult | |
- createWorkflowInvocation: | |
call: http.post | |
args: | |
url: ${"https://dataform.googleapis.com/v1beta1/" + parent + "/workflowInvocations"} | |
auth: | |
type: OAuth2 | |
body: | |
compilationResult: ${compilationResult.body.name} | |
invocationConfig: | |
fullyRefreshIncrementalTablesEnabled: false | |
includedTags: ["ga4"] | |
includedTargets: [] | |
transitiveDependenciesIncluded: true | |
transitiveDependentsIncluded: false | |
result: workflowInvocation | |
- complete: | |
return: ${workflowInvocation.body.name + " complete"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment