์ง์ ๋ ์ํฌํ๋ก ์คํ ๊ธฐ๋ก์ ๋จ๊ณ ํญ๋ชฉ ๋ชฉ๋ก์ผ๋ก ๊ฒ์ํ ์ ์์ต๋๋ค. ๊ฐ ๋จ๊ณ ํญ๋ชฉ์ ์ํฌํ๋ก๋ฅผ ๋ถ์, ๋๋ฒ๊น , ์ต์ ํํ ๋ ๋์์ด ๋ ์ ์๋ ์ ๋ณด๋ฅผ ์ ๊ณตํฉ๋๋ค. ์๋ฅผ ๋ค์ด ์ค์ ๋ก ์คํ๋ ๋จ๊ณ๋ฅผ ํ์ธํ๊ณ ๋จ๊ณ์ ๊ธฐ๊ฐ ๋ฐ ์ฑ๊ณต ์ฌ๋ถ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค. ์ด๋ ํฌ๊ฑฐ๋ ๋ณต์กํ ๋น์ ํ ์ํฌํ๋ก(์: ์ฌ๋ฌ ๋ณ๋ ฌ ๋ธ๋์น๊ฐ ์๋ ์ํฌํ๋ก)๋ฅผ ๋๋ฒ๊น ํ ๋ ํนํ ์ ์ฉํฉ๋๋ค.
๋จ๊ณ ํญ๋ชฉ์ ์์ค ์ฝ๋์ ์ค์ ๋จ๊ณ(์: assign
๋๋ call
) ๋๋ ์๋ด ๋ธ๋ก(์: for
๋ฃจํ ๋๋ try/retry/except
๋ธ๋ก)์ ๋ํ๋
๋๋ค. ๋จ๊ณ ์ ํ์ ์ ์ฒด ๋ชฉ๋ก์ StepType์ ์ฐธ์กฐํ์ธ์.
์คํ ๊ธฐ๋ก ์์ค
์ํฌํ๋ก๋ฅผ ๋ง๋ค๊ฑฐ๋ ์คํํ ๋ ๊ธฐ๋ณธ ๋๋ ์ธ๋ถ ์คํ ๊ธฐ๋ก์ ์ง์ ํ ์ ์์ต๋๋ค. ์ด ์ค์ ์ ์ํฌํ๋ก ๋๋ ์คํ ์์ค์์ ์ ์ฉํ ์ ์์ต๋๋ค.
๊ธฐ๋ณธ์ ์ผ๋ก ์คํ ๊ธฐ๋ก ์์ค์ ์ง์ ๋์ง ์์ผ๋ฉฐ ๊ธฐ๋ณธ ๋จ๊ณ ํญ๋ชฉ์ด ๋ฐํ๋ฉ๋๋ค.
์คํ ๊ธฐ๋ก์ ๋ฒ์ ๋ด ๋ณ์ ๊ฐ๊ณผ ํด๋นํ๋ ๊ฒฝ์ฐ ์์ ๋ฐ๋ณต ํ์ (์: for
๋ฃจํ ๋๋ ๋ณ๋ ฌ ๋ถ๊ธฐ๋ ๋ฐ๋ณต ์ฌ์ฉ ์)๋ฅผ ํฌํจํ๋ ค๋ฉด ์คํ ๊ธฐ๋ก ์์ค์ Detailed๋ก ์ค์ ํด์ผ ํฉ๋๋ค.
์คํ์ ์คํ ๊ธฐ๋ก ์์ค์ด ์ง์ ๋์ง ์์ ๊ฒฝ์ฐ ์ํฌํ๋ก์ ์ ์ฉ๋ ์์ค์ ๋ฐ๋ผ ๊ฒฐ์ ๋ฉ๋๋ค. ์์ค์ด ๋ค๋ฅธ ๊ฒฝ์ฐ ์คํ ์์ค์์ ์ ์ฉ๋ ์ค์ ์ด ํด๋น ์คํ์ ์ํฌํ๋ก ์์ค์์ ์ ์ฉ๋ ์ค์ ์ ์ฌ์ ์ํฉ๋๋ค.
๋จ๊ณ ํญ๋ชฉ์ ๊ฒ์ํ๋ ๋ฐฉ๋ฒ
Workflow Executions REST API์ ์์ฒญ์ ๋ณด๋ด๊ฑฐ๋ Google Cloud ์ฝ์์ ํตํด ๋จ๊ณ ํญ๋ชฉ์ ๊ฒ์ํ ์ ์์ต๋๋ค.
Google Cloud ์ฝ์ - ์ด ๋ฌธ์์ ์ฝ์์์ ๋จ๊ณ ํญ๋ชฉ ๋ณด๊ธฐ๋ฅผ ์ฐธ๊ณ ํ์ธ์.
์ฝ์์ ๋จ๊ณ ํญ๋ชฉ๊ณผ ์ธ๋ถ์ ๋ณด๋ฅผ ๋์ดํ๋ ๊ฒ ์ธ์๋ ์คํ ๋จ๊ณ๋ฅผ ๊ทธ๋ํฝ์ผ๋ก ํ์ํ์ฌ ์ํฌํ๋ก ์คํ ๊ฒฝ๋ก๋ฅผ ์ฝ๊ฒ ๋ณด๊ณ ๋ถ์ํ ์ ์์ต๋๋ค.
Workflow Executions REST APIโ์ด ๋ฌธ์์ ๋จ๊ณ ํญ๋ชฉ ๊ฒ์ ๋ฐ ๋จ๊ณ ํญ๋ชฉ ๋์ด์ ์ฐธ์กฐํ์ธ์.
๋จ๊ณ ํญ๋ชฉ ์ ๋ณด
๋จ๊ณ ํญ๋ชฉ์๋ ๋ค์ ์ ๋ณด๊ฐ ํฌํจ๋ฉ๋๋ค. ์ธ๋ถ ๋จ๊ณ ํญ๋ชฉ์๋ ๊ธฐ๋ณธ ๋จ๊ณ ํญ๋ชฉ ์ ๋ณด๋ ํฌํจ๋ฉ๋๋ค.
์์ธํ ๋ด์ฉ์ ์ด ๋ฌธ์์ ์์๋ฅผ ์ฐธ๊ณ ํ์ธ์.
๊ธฐ๋ณธ ๋จ๊ณ ํญ๋ชฉ ์ ๋ณด
์ด๋ฆ | ๋จ๊ณ ํญ๋ชฉ์ ์ ์ฒด ๋ฆฌ์์ค ์ด๋ฆ์ผ๋ก, ๋ค์๊ณผ ๊ฐ์ ํ์์ ๊ณ ์ ID์ด๋ฉฐ ์ฌ๊ธฐ์ STEPENTRY_ID ๋ ์ฆ๊ฐํ๋ ์นด์ดํฐ์
๋๋ค.
|
์์ฑ ๋ฐ ์ ๋ฐ์ดํธ ์๊ฐ | ๋จ๊ณ ํญ๋ชฉ์ ์์ฑ ์๊ฐ ๋ฐ ์ต๊ทผ ์
๋ฐ์ดํธ์ ํ์์คํฌํ์
๋๋ค. ๋จ๊ณ ํญ๋ชฉ์ด ์๋ฃ๋ ๊ฒฝ์ฐ updateTime ์ ์๋ฃ ์๊ฐ์ ๋ํ๋
๋๋ค.
|
๋ฃจํด ๋ฐ ๋จ๊ณ ์ด๋ฆ | ๋จ๊ณ ํญ๋ชฉ์ด ์ํ ๋ฃจํด ๋ฐ ๋จ๊ณ์ ์ด๋ฆ์
๋๋ค. ๋ฃจํด ์ด๋ฆ์ YAML ๋๋ JSON ์์ค ์ฝ๋์ ์ ์๋ ํ์ ์ํฌํ๋ก ์ด๋ฆ์
๋๋ค. ์ต์์ ๋ฃจํด ์ด๋ฆ์ main ์
๋๋ค.
|
์ํ ๋ฐ ์งํ๋ฅ ์ ํ | ๋จ๊ณ ํญ๋ชฉ์ ์ํ(์: ํญ๋ชฉ์ ์ฑ๊ณต ๋๋ ์คํจ, ๋จ๊ณ ํญ๋ชฉ์ด ์งํ ์ค์ธ ๊ฒฝ์ฐ ๋ฐ ์งํ ์ ํ)์ ๋๋ค. ์ํ์ ์งํ๋ฅ ์ ํ์ ์ ์ฒด ๋ชฉ๋ก์ State์ ProgressType์ ์ฐธ์กฐํ์ธ์. |
ํ์ ์ ๋ณด | ์ํฌํ๋ก์ ๊ณ์ธต ๊ตฌ์กฐ์ ํ๋ฆ์ ๋ ์ ์ดํดํ ์ ์๋ ๋จ๊ณ ํญ๋ชฉ์ ์์น(์: ํ์ฌ ๋จ๊ณ ํญ๋ชฉ์ ์์ด๋ ๋ค์ ์ค๋ ๋จ๊ณ ํญ๋ชฉ ๋๋ ๋จ๊ณ ํญ๋ชฉ์ ์์ ๋๋ ํ์ ์์)์ ๋๋ค. ์์ธํ ๋ด์ฉ์ NavigationInfo๋ฅผ ์ฐธ์กฐํ์ธ์. |
๋ฉํ๋ฐ์ดํฐ | ๋ฐ๋ณต ๋จ๊ณ ํญ๋ชฉ๊ณผ ๊ด๋ จ๋ ๋ฐ์ดํฐ๋ก, ๋ค์์ด ํฌํจ๋ ์ ์์ต๋๋ค.
|
์์ธ | ์์ธ์ ๊ด๋ จ์ด ์์ผ๋ฉฐ ๋จ๊ณ ํญ๋ชฉ์ด ์คํจํ ์ด์ ์ ๋ํ ์ค๋ช ์ ์ ๊ณตํ๋ ํ์ด๋ก๋์ ๋๋ค. |
์ธ๋ถ ๋จ๊ณ ํญ๋ชฉ ์ ๋ณด
๋ฉํ๋ฐ์ดํฐ | ํด๋นํ๋ ๊ฒฝ์ฐ ๋จ๊ณ์ ์งํ๋ฅ ์ ์์๋๋ ๋ฐ๋ณต ํ์์
๋๋ค. ์๋ฅผ ๋ค์ด ๊ณ์ฐ๋ ๊ฐ์๋ ๋ฃจํ ๊ฒฝ๊ณ์ ๋ค์ ์ค ํ๋๋ฅผ ํตํฉํ๋ ํํ์์ด ํฌํจ๋ ๊ฒฝ์ฐ ์์๋๋ก ์๋ํ์ง ์์ต๋๋ค.
|
๋ณ์ ๋ฐ์ดํฐ | ์ด ๋จ๊ณ์ ๊ด๋ จ๋ ๋ฒ์ ๋ด ๋ณ์ ๊ฐ์ ๊ดํ ๋ฐ์ดํฐ์ ๋๋ค. ์ฌ๊ธฐ์๋ ์ฌ์ฉ์ ์ ์ ๋ก์ปฌ ๋ณ์์ ์ด๋ฆ๊ณผ ๊ฐ, ํํ์ ํ๊ฐ ๊ฒฐ๊ณผ๊ฐ ํฌํจ๋ฉ๋๋ค. ๋ฒ์์๋ Workflows ๊ธฐ๋ณธ ์ ๊ณต ํจ์์ ์ฐ๊ฒฐ๋ ๋ด๋ถ ๋ณ์๊ฐ ์ ์ธ๋ฉ๋๋ค. ์์ธํ ๋ด์ฉ์ VariableData๋ฅผ ์ฐธ๊ณ ํ์ธ์. |
์ฝ์์์ ๋จ๊ณ ํญ๋ชฉ ๋ณด๊ธฐ
Google Cloud ์ฝ์์์ ํน์ ์ํฌํ๋ก ์คํ์ ๋จ๊ณ ํญ๋ชฉ์ ๋ณผ ์ ์์ต๋๋ค.
Google Cloud ์ฝ์์์ Workflows ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
์ํฌํ๋ก ์ด๋ฆ์ ํด๋ฆญํ์ฌ ์ํฌํ๋ก ์ธ๋ถ์ ๋ณด ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
ํน์ ์คํ์ ๋ํ ์ธ๋ถ์ ๋ณด๋ฅผ ๋ณด๋ ค๋ฉด ์คํ ID๋ฅผ ํด๋ฆญํฉ๋๋ค.
์์ฝ ํญ์๋ ์คํ ์คํจ๋ก ์ด์ด์ง ์์ธ๋ฅผ ํฌํจํ์ฌ ์ ์ฒด ์คํ ๊ด๋ จ ์ ๋ณด๊ฐ ์ ๊ณต๋ฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ์คํ ์ค๋ฅ ๋งต์ ์ฐธ๊ณ ํ์ธ์.
์ํฌํ๋ก ์คํ ๊ธฐ๋ก์ ๋จ๊ณ ํญ๋ชฉ ๋ชฉ๋ก์ผ๋ก ๋ณด๋ ค๋ฉด ๋จ๊ณ ํญ์ ํด๋ฆญํฉ๋๋ค.
์ํฌํ๋ก ์คํ์ ๋ชจ๋ ๋จ๊ณ ํญ๋ชฉ์ด ๋์ด๋ฉ๋๋ค.
๋จ๊ณ ํญ๋ชฉ์ ํํฐ๋งํ๋ ค๋ฉด ํ ์ด๋ธ ์๋จ์ ํํฐ ํ๋๋ฅผ ์ฌ์ฉํ์ฌ ์์ฑ๊ณผ ๊ฐ์ ์ ํํฉ๋๋ค(์:
State: Failed
).์์, ํ์, ๋ค์, ์ด์ ๋จ๊ณ ํญ๋ชฉ์ ๋งํฌ๋ฅผ ํ์ํ๋ ค๋ฉด ํน์ ๋จ๊ณ ํญ๋ชฉ์ ํด๋ฆญํฉ๋๋ค.
๋งํฌ๋ฅผ ํด๋ฆญํ๋ฉด ๋ค๋ฅธ ๋งํฌ๊ฐ ์๋์ผ๋ก ์ ๋ฐ์ดํธ๋ฉ๋๋ค. ์๋ฅผ ๋ค์ด ์์๋ ํด๋ฆญํ ๋จ๊ณ ํญ๋ชฉ์ ์์ ์์์ ์ฐ๊ฒฐ๋ฉ๋๋ค.
์๊ฐํ ํจ๋์ ์ํฌํ๋ก ๋จ๊ณ๋ฅผ ๊ทธ๋ํฝ์ผ๋ก ํ์ํ๊ณ ์ํฌํ๋ก ๊ฒฝ๋ก๋ฅผ ์ดํดํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.
์๊ฐํ๋ ๋จ๊ณ ํญ๋ชฉ๊ณผ ๋ค๋ฅผ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด
for
๋ธ๋ก์ ์๊ฐํ์์ ๋จ์ผ ๊ตฌ์ฑ์์๋ก ํํ๋ฉ๋๋ค. ํ์ง๋ง ๋ฐ๋ณต ํ์์ ๋ฐ๋ผ ์ฌ๋ฌ ๋จ๊ณ ํญ๋ชฉ์ด ์์ ์ ์์ต๋๋ค.ํจ๋์์ ๋ค์ ์์ ์ ํ ์ ์์ต๋๋ค.
- ์๊ฐํ ํ๋ ๋๋ ์ถ์
- ์์ ๋จ๊ณ ํญ๋ชฉ ์ ๊ธฐ ๋๋ ํผ์น๊ธฐ
- ๋จ๊ณ ํญ๋ชฉ์ ํด๋ฆญํ๊ณ ์ด์ ๋ฐ ๋ค์ ํญ๋ชฉ ๋ณด๊ธฐ
- ๋ น์ ์ฒดํฌํ์ ๋๋ ๋นจ๊ฐ์ ๋๋ํ๋ก ํ์๋ ์ฑ๊ณต ๋ฐ ์คํจํ ๋จ๊ณ ํญ๋ชฉ ํ์ธ
- ํผ์น๊ธฐ ํ์ดํ๋ฅผ ํด๋ฆญํ์ฌ ์๊ฐํ ํจ๋ ๋ซ๊ธฐ, ๋ค์ ํด๋ฆญํ์ฌ ํจ๋ ์ด๊ธฐ
๋จ๊ณ ํญ๋ชฉ์ ๊ฒ์ํ๊ธฐ ์ ์
๋จ๊ณ ํญ๋ชฉ์ ๊ฒ์ํ๋ ๋ฐ ํ์ํ ๊ถํ์ ์ป์ผ๋ ค๋ฉด ๊ด๋ฆฌ์์๊ฒ ํ๋ก์ ํธ์ ๋ํ Workflows ๊ด๋ฆฌ์ (workflows.stepEntries.get
) IAM ์ญํ ์ ๋ถ์ฌํด ๋ฌ๋ผ๊ณ ์์ฒญํ์ธ์.
์ญํ ๋ถ์ฌ์ ๋ํ ์์ธ ์ค๋ช
์ ํ๋ก์ ํธ, ํด๋, ์กฐ์ง์ ๋ํ ์ก์ธ์ค ๊ด๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์.
๋ง์ถค ์ญํ ์ด๋ ๋ค๋ฅธ ์ฌ์ ์ ์๋ ์ญํ ์ ํตํด ํ์ํ ๊ถํ์ ์ป์ ์๋ ์์ต๋๋ค.
๋จ๊ณ ํญ๋ชฉ ๊ฒ์
์ง์ ๋ ์ํฌํ๋ก ์คํ์ ๋จ๊ณ ํญ๋ชฉ์ ๊ฒ์ํ๋ ค๋ฉด projects.locations.workflows.executions.stepEntries.get
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_NUMBER
: IAM ๋ฐ ๊ด๋ฆฌ์ ์ค์ ํ์ด์ง์ ๋์ด๋ Google Cloudํ๋ก์ ํธ ๋ฒํธ์ ๋๋ค.LOCATION
: ์ํฌํ๋ก๊ฐ ๋ฐฐํฌ๋๋ ๋ฆฌ์ ์ ๋๋ค(์:us-central1
).WORKFLOW_ID
: ์ํฌํ๋ก์ ์ฌ์ฉ์ ์ ์ ์ด๋ฆ์ ๋๋ค(์:myFirstWorkflow
).EXECUTION_ID
: ์ํฌํ๋ก๊ฐ ์คํ๋ ํ ๋ฐํ๋๋ ์ํฌํ๋ก ์คํ์ ๊ณ ์ ID์ ๋๋ค.STEPENTRY_ID
: ๋จ๊ณ ํญ๋ชฉ์ ๊ณ ์ ID์ ๋๋ค(์:1
).
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ํผ์นฉ๋๋ค.
๋ค์๊ณผ ๋น์ทํ JSON ์๋ต์ด ํ์๋ฉ๋๋ค.
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/workflows/WORKFLOW_ID/executions/EXECUTION_ID/stepEntries/STEPENTRY_ID", "createTime": "2024-08-15T19:03:08.328851864Z", "updateTime": "2024-08-15T19:03:08.331099634Z", "routine": "main", "step": "checkSearchTermInInput", "stepType": "STEP_CONDITION", "state": "STATE_SUCCEEDED", "entryId": "2", "navigationInfo": { "children": [ "3" ], "parent": "1", "next": "3", "previous": "1" }, "variableData": {} }
๋จ๊ณ ํญ๋ชฉ์ ๋์ดํ๊ธฐ ์ ์
๋จ๊ณ ํญ๋ชฉ์ ๋์ดํ๋ ๋ฐ ํ์ํ ๊ถํ์ ์ป์ผ๋ ค๋ฉด ๊ด๋ฆฌ์์๊ฒ ํ๋ก์ ํธ์ ๋ํ Workflows ๊ด๋ฆฌ์ (workflows.stepEntries.list
) IAM ์ญํ ์ ๋ถ์ฌํด ๋ฌ๋ผ๊ณ ์์ฒญํ์ธ์.
์ญํ ๋ถ์ฌ์ ๋ํ ์์ธ ์ค๋ช
์ ํ๋ก์ ํธ, ํด๋, ์กฐ์ง์ ๋ํ ์ก์ธ์ค ๊ด๋ฆฌ๋ฅผ ์ฐธ์กฐํ์ธ์.
๋ง์ถค ์ญํ ์ด๋ ๋ค๋ฅธ ์ฌ์ ์ ์๋ ์ญํ ์ ํตํด ํ์ํ ๊ถํ์ ์ป์ ์๋ ์์ต๋๋ค.
๋จ๊ณ ํญ๋ชฉ ๋์ด
์ ๊ณต๋ ์ํฌํ๋ก ์คํ์ ๋จ๊ณ ํญ๋ชฉ์ ๋์ดํ๋ ค๋ฉด projects.locations.workflows.executions.stepEntries.list
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก ๊ฒฐ๊ณผ๋ ๋จ๊ณ ํญ๋ชฉ์ createTime
์ ์ค๋ฆ์ฐจ์์ผ๋ก ๋ฐํ๋ฉ๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
PROJECT_NUMBER
: IAM ๋ฐ ๊ด๋ฆฌ์ ์ค์ ํ์ด์ง์ ๋์ด๋ Google Cloudํ๋ก์ ํธ ๋ฒํธ์ ๋๋ค.LOCATION
: ์ํฌํ๋ก๊ฐ ๋ฐฐํฌ๋๋ ๋ฆฌ์ ์ ๋๋ค(์:us-central1
).WORKFLOW_ID
: ์ํฌํ๋ก์ ์ฌ์ฉ์ ์ ์ ์ด๋ฆ์ ๋๋ค(์:myFirstWorkflow
).EXECUTION_ID
: ์ํฌํ๋ก๊ฐ ์คํ๋ ํ ๋ฐํ๋๋ ์ํฌํ๋ก ์คํ์ ๊ณ ์ ID์ ๋๋ค.
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ํผ์นฉ๋๋ค.
๋ค์๊ณผ ๋น์ทํ JSON ์๋ต์ด ํ์๋ฉ๋๋ค.
{ "stepEntries": [ { "name": "projects/PROJECT_NUMBER/locations/LOCATION/workflows/WORKFLOW_ID/executions/EXECUTION_ID/stepEntries/1", "createTime": "2024-08-15T19:03:08.328807964Z", "updateTime": "2024-08-15T19:03:08.331099694Z", "routine": "main", "step": "checkSearchTermInInput", "stepType": "STEP_SWITCH", "state": "STATE_SUCCEEDED", "entryId": "1", "navigationInfo": { "children": [ "2" ], "next": "2" }, "variableData": {} }, { "name": "projects/PROJECT_NUMBER/locations/LOCATION/workflows/WORKFLOW_ID/executions/EXECUTION_ID/stepEntries/2", "createTime": "2024-08-15T19:03:08.328851864Z", "updateTime": "2024-08-15T19:03:08.331099634Z", "routine": "main", "step": "checkSearchTermInInput", "stepType": "STEP_CONDITION", "state": "STATE_SUCCEEDED", "entryId": "2", "navigationInfo": { "children": [ "3" ], "parent": "1", "next": "3", "previous": "1" }, "variableData": {} }, { "name": "projects/PROJECT_NUMBER/locations/LOCATION/workflows/WORKFLOW_ID/executions/EXECUTION_ID/stepEntries/3", "createTime": "2024-08-15T19:03:08.331037314Z", "updateTime": "2024-08-15T19:03:08.331099554Z", "routine": "main", "step": "checkSearchTermInInput.condition1", "stepType": "STEP_ASSIGN", "state": "STATE_SUCCEEDED", "entryId": "3", "navigationInfo": { "parent": "2", "next": "4", "previous": "2" }, "variableData": { "variables": { "input": { "searchTerm": "asia" }, "searchTerm": "asia" } } }, { "name": "projects/PROJECT_NUMBER/locations/LOCATION/workflows/WORKFLOW_ID/executions/EXECUTION_ID/stepEntries/4", "createTime": "2024-08-15T19:03:08.331100404Z", "updateTime": "2024-08-15T19:03:08.633741469Z", "routine": "main", "step": "readWikipedia", "stepType": "STEP_CALL", "state": "STATE_SUCCEEDED", "entryId": "4", "navigationInfo": { "next": "5", "previous": "3" }, "variableData": {} }, { "name": "projects/PROJECT_NUMBER/locations/LOCATION/workflows/WORKFLOW_ID/executions/EXECUTION_ID/stepEntries/5", "createTime": "2024-08-15T19:03:08.633969694Z", "updateTime": "2024-08-15T19:03:08.634063018Z", "routine": "main", "step": "returnOutput", "stepType": "STEP_RETURN", "state": "STATE_SUCCEEDED", "entryId": "5", "navigationInfo": { "previous": "4" }, "variableData": { "variables": { "wikiResult": { "headers": { ... }, "body": [ ... ], "code": 200 }, "input": { "searchTerm": "asia" }, "searchTerm": "asia" } } } ], "totalSize": 5 }
๋จ๊ณ ํญ๋ชฉ ์ญ์
์ง์ ๋ ์ํฌํ๋ก ์คํ์ ๋ชจ๋ ๋จ๊ณ ํญ๋ชฉ์ ์ญ์ ํ๋ ค๋ฉด projects.locations.workflows.executions.deleteExecutionHistory
๋ฉ์๋๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์์ฒญ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ๋ค์์ ๋ฐ๊ฟ๋๋ค.
WORKFLOW_NAME
: ์ํฌํ๋ก์ ์ด๋ฆ์ ๋๋ค.PROJECT_NUMBER
: Google Cloudํ๋ก์ ํธ ๋ฒํธLOCATION
: ์ํฌํ๋ก๊ฐ ๋ฐฐํฌ๋๋ ๋ฆฌ์ ์ ๋๋ค(์:us-central1
).EXECUTION_ID
: ๋จ๊ณ ํญ๋ชฉ์ ์ญ์ ํด์ผ ํ๋ ์คํ์ ID์ ๋๋ค.
์์ฒญ์ ๋ณด๋ด๋ ค๋ฉด ๋ค์ ์ต์ ์ค ํ๋๋ฅผ ํผ์นฉ๋๋ค.
์ฑ๊ณตํ ๊ฒฝ์ฐ ์๋ต ๋ณธ๋ฌธ์ ๋น์ด ์์ต๋๋ค.
์์
for
๋ธ๋ก์ ์ฌ์ฉํ ์ํฌํ๋ก
์ํฌํ๋ก
YAML
- assignStep: assign: - sum: 0 - forStep: for: range: [1, 2] value: v steps: - sumStep: assign: - sum: ${sum + v} - returnStep: return: ${sum}
JSON
[ { "assignStep": { "assign": [ { "sum": 0 } ] } }, { "forStep": { "for": { "range": [ 1, 2 ], "value": "v", "steps": [ { "sumStep": { "assign": [ { "sum": "${sum + v}" } ] } } ] } } }, { "returnStep": { "return": "${sum}" } } ]
๋ค์ด์ด๊ทธ๋จ
for
๋ธ๋ก์ด ์๋ ์ํฌํ๋ก(๋ค์ด์ด๊ทธ๋จ์ ํด๋ฆญํ์ฌ ํ๋)๋จ๊ณ ํญ๋ชฉ
{ "stepEntries": [ { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-for-block/executions/0bc47b85-a399-4101-b629-1f623802e32d/stepEntries/1", "createTime": "2024-08-15T19:32:18.119578307Z", "updateTime": "2024-08-15T19:32:18.119661828Z", "routine": "main", "step": "assignStep", "stepType": "STEP_ASSIGN", "state": "STATE_SUCCEEDED", "entryId": "1", "navigationInfo": { "next": "2" }, "variableData": { "variables": { "sum": 0 } } }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-for-block/executions/0bc47b85-a399-4101-b629-1f623802e32d/stepEntries/2", "createTime": "2024-08-15T19:32:18.119662643Z", "updateTime": "2024-08-15T19:32:18.120893531Z", "routine": "main", "step": "forStep", "stepType": "STEP_FOR", "state": "STATE_SUCCEEDED", "entryId": "2", "navigationInfo": { "children": [ "3", "5" ], "next": "3", "previous": "1" }, "stepEntryMetadata": { "progressType": "PROGRESS_TYPE_FOR", "expectedIteration": "2" }, "variableData": {} }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-for-block/executions/0bc47b85-a399-4101-b629-1f623802e32d/stepEntries/3", "createTime": "2024-08-15T19:32:18.119732820Z", "updateTime": "2024-08-15T19:32:18.120463449Z", "routine": "main", "step": "forStep", "stepType": "STEP_FOR_ITERATION", "state": "STATE_SUCCEEDED", "entryId": "3", "navigationInfo": { "children": [ "4" ], "parent": "2", "next": "4", "previous": "2" }, "stepEntryMetadata": { "progressType": "PROGRESS_TYPE_FOR", "progressNumber": "1" }, "variableData": {} }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-for-block/executions/0bc47b85-a399-4101-b629-1f623802e32d/stepEntries/4", "createTime": "2024-08-15T19:32:18.119737066Z", "updateTime": "2024-08-15T19:32:18.120463358Z", "routine": "main", "step": "sumStep", "stepType": "STEP_ASSIGN", "state": "STATE_SUCCEEDED", "entryId": "4", "navigationInfo": { "parent": "3", "next": "5", "previous": "3" }, "stepEntryMetadata": { "progressType": "PROGRESS_TYPE_FOR", "progressNumber": "1" }, "variableData": { "variables": { "sum": 1, "v": 1 } } }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-for-block/executions/0bc47b85-a399-4101-b629-1f623802e32d/stepEntries/5", "createTime": "2024-08-15T19:32:18.120465172Z", "updateTime": "2024-08-15T19:32:18.120893471Z", "routine": "main", "step": "forStep", "stepType": "STEP_FOR_ITERATION", "state": "STATE_SUCCEEDED", "entryId": "5", "navigationInfo": { "children": [ "6" ], "parent": "2", "next": "6", "previous": "4" }, "stepEntryMetadata": { "progressType": "PROGRESS_TYPE_FOR", "progressNumber": "2" }, "variableData": {} }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-for-block/executions/0bc47b85-a399-4101-b629-1f623802e32d/stepEntries/6", "createTime": "2024-08-15T19:32:18.120470187Z", "updateTime": "2024-08-15T19:32:18.120893389Z", "routine": "main", "step": "sumStep", "stepType": "STEP_ASSIGN", "state": "STATE_SUCCEEDED", "entryId": "6", "navigationInfo": { "parent": "5", "next": "7", "previous": "5" }, "stepEntryMetadata": { "progressType": "PROGRESS_TYPE_FOR", "progressNumber": "2" }, "variableData": { "variables": { "sum": 3, "v": 2 } } }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-for-block/executions/0bc47b85-a399-4101-b629-1f623802e32d/stepEntries/7", "createTime": "2024-08-15T19:32:18.120894873Z", "updateTime": "2024-08-15T19:32:18.121003185Z", "routine": "main", "step": "returnStep", "stepType": "STEP_RETURN", "state": "STATE_SUCCEEDED", "entryId": "7", "navigationInfo": { "previous": "6" }, "variableData": { "variables": { "sum": 3 } } } ], "totalSize": 7 }
ํ์ ์ํฌํ๋ก ํธ์ถ์ ์ฌ์ฉํ ์ํฌํ๋ก
์ํฌํ๋ก
YAML
main: steps: - callStep: call: square args: x: 10 result: t - retStep: return: ${t} square: params: [x] steps: - assignStep: assign: - y: ${x*x} - retStep: return: ${y}
JSON
{ "main": { "steps": [ { "callStep": { "call": "square", "args": { "x": 10 }, "result": "t" } }, { "retStep": { "return": "${t}" } } ] }, "square": { "params": [ "x" ], "steps": [ { "assignStep": { "assign": [ { "y": "${x*x}" } ] } }, { "retStep": { "return": "${y}" } } ] } }
๋ค์ด์ด๊ทธ๋จ
๋จ๊ณ ํญ๋ชฉ
{ "stepEntries": [ { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-subworkflow-call/executions/e203bc96-a1cf-47ba-b6de-f3d1b0909664/stepEntries/1", "createTime": "2024-08-15T19:37:44.162778920Z", "updateTime": "2024-08-15T19:37:44.168683007Z", "routine": "main", "step": "callStep", "stepType": "STEP_CALL", "state": "STATE_SUCCEEDED", "entryId": "1", "navigationInfo": { "children": [ "2", "3" ], "next": "2" }, "variableData": { "variables": { "t": 100 } } }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-subworkflow-call/executions/e203bc96-a1cf-47ba-b6de-f3d1b0909664/stepEntries/2", "createTime": "2024-08-15T19:37:44.168598736Z", "updateTime": "2024-08-15T19:37:44.168657969Z", "routine": "square", "step": "assignStep", "stepType": "STEP_ASSIGN", "state": "STATE_SUCCEEDED", "entryId": "2", "navigationInfo": { "parent": "1", "next": "3", "previous": "1" }, "variableData": { "variables": { "y": 100, "x": 10 } } }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-subworkflow-call/executions/e203bc96-a1cf-47ba-b6de-f3d1b0909664/stepEntries/3", "createTime": "2024-08-15T19:37:44.168659349Z", "updateTime": "2024-08-15T19:37:44.168676547Z", "routine": "square", "step": "retStep", "stepType": "STEP_RETURN", "state": "STATE_SUCCEEDED", "entryId": "3", "navigationInfo": { "parent": "1", "next": "4", "previous": "2" }, "variableData": { "variables": { "x": 10, "y": 100 } } }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-subworkflow-call/executions/e203bc96-a1cf-47ba-b6de-f3d1b0909664/stepEntries/4", "createTime": "2024-08-15T19:37:44.168693503Z", "updateTime": "2024-08-15T19:37:44.168702324Z", "routine": "main", "step": "retStep", "stepType": "STEP_RETURN", "state": "STATE_SUCCEEDED", "entryId": "4", "navigationInfo": { "previous": "3" }, "variableData": { "variables": { "t": 100 } } } ], "totalSize": 4 }
์คํจํ ๋จ๊ณ ํญ๋ชฉ์ด ์๋ ์ํฌํ๋ก
์ํฌํ๋ก
YAML
- tryStep: try: return: ${1 / 0} except: return: 0
JSON
[ { "tryStep": { "try": { "return": "${1 / 0}" }, "except": { "return": 0 } } } ]
๋ค์ด์ด๊ทธ๋จ
๋จ๊ณ ํญ๋ชฉ
{ "stepEntries": [ { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-failed-step/executions/a19d20d1-e446-4d37-b548-8005297b7d3d/stepEntries/1", "createTime": "2024-08-15T19:42:51.415433810Z", "updateTime": "2024-08-15T19:42:51.416106923Z", "routine": "main", "step": "tryStep", "stepType": "STEP_TRY_RETRY_EXCEPT", "state": "STATE_SUCCEEDED", "entryId": "1", "navigationInfo": { "children": [ "2", "4" ], "next": "2" }, "variableData": {} }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-failed-step/executions/a19d20d1-e446-4d37-b548-8005297b7d3d/stepEntries/2", "createTime": "2024-08-15T19:42:51.415439617Z", "updateTime": "2024-08-15T19:42:51.416065206Z", "routine": "main", "step": "tryStep", "stepType": "STEP_TRY", "state": "STATE_FAILED", "entryId": "2", "navigationInfo": { "children": [ "3" ], "parent": "1", "next": "3", "previous": "1" }, "variableData": {} }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-failed-step/executions/a19d20d1-e446-4d37-b548-8005297b7d3d/stepEntries/3", "createTime": "2024-08-15T19:42:51.415441815Z", "updateTime": "2024-08-15T19:42:51.416064665Z", "routine": "main", "step": "tryStep.try", "stepType": "STEP_RETURN", "state": "STATE_FAILED", "exception": { "payload": "{\"message\":\"ZeroDivisionError: division by zero\",\"tags\":[\"ZeroDivisionError\",\"ArithmeticError\"]}" }, "entryId": "3", "navigationInfo": { "parent": "2", "next": "4", "previous": "2" }, "variableData": {} }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-failed-step/executions/a19d20d1-e446-4d37-b548-8005297b7d3d/stepEntries/4", "createTime": "2024-08-15T19:42:51.416071869Z", "updateTime": "2024-08-15T19:42:51.416106840Z", "routine": "main", "step": "tryStep", "stepType": "STEP_EXCEPT", "state": "STATE_SUCCEEDED", "entryId": "4", "navigationInfo": { "children": [ "5" ], "parent": "1", "next": "5", "previous": "3" }, "variableData": {} }, { "name": "projects/1051295516635/locations/us-central1/workflows/workflow-failed-step/executions/a19d20d1-e446-4d37-b548-8005297b7d3d/stepEntries/5", "createTime": "2024-08-15T19:42:51.416087217Z", "updateTime": "2024-08-15T19:42:51.416106742Z", "routine": "main", "step": "tryStep.except", "stepType": "STEP_RETURN", "state": "STATE_SUCCEEDED", "entryId": "5", "navigationInfo": { "parent": "4", "previous": "4" }, "variableData": {} } ], "totalSize": 5 }