While Loop 태스크를 사용하면 지정된 조건이 충족될 때까지 현재(기본) 통합에서 하위 통합으로 반복 호출을 수행할 수 있습니다.
API 트리거 ID 및 통합 이름은 실행할 하위 통합을 식별합니다.
또한 태스크를 통해 각 하위 통합 실행에서 응답을 수집하고 다운스트림 태스크에 사용할 수 있도록 현재 통합에 값을 저장할 수 있습니다. 다음 방법 중 하나를 사용하여 응답을 수집할 수 있습니다.
배열 변수에서 각 실행의 응답을 수집합니다. 배열의 각 요소에는 하나의 특정 실행에 대한 응답이 있습니다. 응답을 수집하려면 Collect values from sub-integration output(s) 속성을 구성합니다.
단일 변수에서 모든 실행의 응답을 집계합니다. 응답을 집계하려면 Override values from sub-integration output(s) 속성을 구성합니다.
시작하기 전에
통합에 사용자 관리형 서비스 계정을 연결했는지 확인합니다. 통합에 사용자 관리형 서비스 계정이 구성되어 있지 않으면 기본적으로 인증에 기본 서비스 계정(service-PROJECT_NUMBER@gcp-sa-integrations.iam.gserviceaccount.com)이 사용됩니다.
서비스 계정에 Application Integration 호출자 IAM 역할이 있는지 확인합니다. 서비스 계정에 역할 부여에 대한 자세한 내용은 서비스 계정에 대한 액세스 관리를 참조하세요.
구성 속성
다음 표에서는 While 루프 태스크의 구성 속성을 설명합니다.
속성
데이터 유형
설명
API Trigger ID
문자열
실행할 하위 통합의 트리거 ID입니다.
이 값은 하위 통합의 API 트리거의 트리거 ID 필드에서 확인할 수 있습니다.
Integration name
문자열
실행할 하위 통합의 이름입니다.
While loop condition
해당 사항 없음
루프를 종료하기 위한 조건입니다. 하위 통합은 조건이 충족될 때까지 실행됩니다. 예를 들면 $loopMetadata.current_iteration_count$< 10입니다.
Map to sub-integration input(s)
해당 없음
현재 통합에서 하위 통합으로 전달할 값입니다.
이 속성 값은 키-값 쌍의 형식입니다. 여기서 키는 현재 통합의 변수이고 값은 하위 통합의 해당 입력 변수입니다. 예를 들어 기본 통합에 subIntProductID 하위 통합 변수에 매핑하려는 productID 변수가 있다고 가정해 보겠습니다. 매핑할 통합 변수 드롭다운에서 productID를 선택하고 매핑할 하위 통합 입력 필드에 subIntProductID를 입력합니다.
Collect values from sub-integration output(s)
해당 없음
하위 통합 실행 결과를 수집합니다.
하위 통합이 실행될 때마다 하위 통합 출력을 현재 통합의 배열 변수에 저장할 수 있습니다. 수집할 하위 통합 출력 필드에 하위 통합 출력 변수를 입력하고 수집할 통합 변수 드롭다운에서 현재 통합의 배열 변수를 선택합니다. 배열의 각 요소에는 특정 하위 통합 실행의 응답이 있습니다. 예를 들어 배열 변수가 resultsArray이면 resultsArray[0]에는 첫 번째 실행의 응답이 있고 resultsArray[1]에는 두 번째 실행의 응답이 있습니다.
Override values from sub-integration output(s)
해당 없음
하위 통합 실행의 출력 변수를 읽고 현재 통합의 변수에 저장합니다.
매핑할 하위 통합 출력 드롭다운에서 하위 통합 출력 변수를 선택하고 재정의할 통합 변수 드롭다운에서 현재 통합의 해당 변수를 선택합니다. 추가 하위 통합 입력에 매핑 속성의 변수를 매핑하여 현재 통합에서 재정의된 변수를 다음 하위 통합 실행에 전송할 수 있습니다. 따라서 하위 통합 실행의 응답을 누적 집계할 수 있습니다.
Loop metadata
JSON 배열
하위 통합 실행 ID, 오류 메시지, 실행 중에 전달된 변수 값과 같은 하위 통합 실행의 실행 세부정보가 있는 출력 변수입니다. 루프 메타데이터에는 current_iteration_count, sub_integration_execution_ids, failure_location, current_element, iteration_element, failure_message 출력 변수를 포함한 변수가 포함됩니다.
권장사항
While 루프 태스크에 적용되는 사용량 한도에 대한 자세한 내용은 사용량 한도를 참조하세요.
오류 처리 전략
태스크의 오류 처리 전략은 일시적인 오류로 인해 태스크가 실패할 경우 수행할 태스크를 지정합니다. 오류 처리 전략을 사용하는 방법과 다양한 유형의 오류 처리 전략에 대한 자세한 내용은 오류 처리 전략을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-06-16(UTC)"],[[["\u003cp\u003eThe While Loop task enables repeated execution of a sub-integration until a specified condition is met, identified by the API Trigger ID and Integration name.\u003c/p\u003e\n"],["\u003cp\u003eResponses from each sub-integration run can be collected and stored, either by collating each run's response into an array or by aggregating all responses into a single variable.\u003c/p\u003e\n"],["\u003cp\u003eThe While Loop task has a maximum limit of 8000 iterations, and the cumulative data collected from sub-integration runs cannot exceed 50 MB.\u003c/p\u003e\n"],["\u003cp\u003eA user-managed service account with the Application Integration Invoker role is required for the integration to run, or it will use the default service account.\u003c/p\u003e\n"],["\u003cp\u003eThe task configuration allows mapping variables between the current integration and the sub-integration, managing loop termination conditions, and collecting or overriding sub-integration outputs.\u003c/p\u003e\n"]]],[],null,["# While Loop task\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nWhile Loop task\n===============\n\nThe **While Loop** task lets you make repeated calls to a sub-integration from\nyour current (main) integration until a specified condition is met.\n\nThe **API Trigger ID** and the **Integration name** identifies the sub-integration you\nwant to run.\n\nThe task also lets you collect the response from each sub-integration run and store the value in your\ncurrent integration for use in downstream tasks. You can use any of the following approach to collect the responses:\n\n- Collate the response of each run in an array variable, where each element of the array has the response from one particular run. To collate the responses, configure the `Collect values from sub-integration output(s)` property.\n- Aggregate the responses of all the runs in a single variable. To aggregate the responses, configure the `Override values from sub-integration output(s)` property.\n\n| **Note** :\n|\n| - The **While Loop** task can run a maximum of 8000 iterations. This constraint holds good even if the configured condition results in an infinte loop.\n| - The cumulative size of the data collected from each sub-integration run cannot exceed `50 MB`. If the size exceeds `50 MB`, the integration fails, and the downstream tasks are not run.\n\nBefore you begin\n----------------\n\n- Ensure that you have [attached a user-managed service account](/application-integration/docs/access-control#add-service-account) to your integration. If your integration does not have user-managed service account configured, then by default the [default service account](/application-integration/docs/access-control#default-service-account) (`service-`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`@gcp-sa-integrations.iam.gserviceaccount.com`) is used for authentication.\n- Ensure that your service account has the **Application Integration Invoker** IAM role. For information about granting roles to a service account, see [Manage access to service accounts](/iam/docs/manage-access-service-accounts).\n\nConfiguration properties\n------------------------\n\n\nThe following table describes the configuration properties of the **While Loop** task.\n\nBest practices\n--------------\n\nFor information about the usage limits that apply to the **While Loop** task, see [Usage limits](/application-integration/docs/quotas#usage-limits).\n\nError handling strategy\n-----------------------\n\n\nAn error handling strategy for a task specifies the action to take if the task fails due to a [temporary error](/application-integration/docs/error-handling). For information about how to use an error handling strategy, and to know about the different types of error handling strategies, see [Error handling strategies](/application-integration/docs/error-handling-strategy).\n\nQuotas and limits\n-----------------\n\nFor information about quotas and limits, see [Quotas and limits](/application-integration/docs/quotas).\n\nWhat's next\n-----------\n\n- Learn about [all tasks and triggers](/application-integration/docs/all-triggers-tasks).\n- Learn how to [test and publish an integration](/application-integration/docs/test-publish-integrations).\n\n- Learn about [error handling](/application-integration/docs/error-handling-strategy).\n- Learn about [integration execution logs](/application-integration/docs/introduction-logs)."]]