Application Integration에 지원되는 커넥터를 참조하세요.
하위 통합을 호출하여 이메일 전송
For Each 루프 태스크를 사용하여 기본 통합에서 입력을 가져오는 하위 통합을 호출하여 이메일 알림을 보냅니다.
코드 샘플: 하위 통합
{
"triggerConfigs": [{
"label": "API Trigger",
"startTasks": [{
"taskId": "1"
}],
"properties": {
"Trigger name": "SubIntegrationSendEmailDemo_API_1"
},
"triggerType": "API",
"triggerNumber": "1",
"triggerId": "api_trigger/SubIntegrationSendEmailDemo_API_1"
}],
"taskConfigs": [{
"task": "EmailTask",
"taskId": "1",
"parameters": {
"Cc": {
"key": "Cc",
"value": {
"stringArray": {
}
}
},
"TextBody": {
"key": "TextBody",
"value": {
"stringValue": "$EmailContent$"
}
},
"Bcc": {
"key": "Bcc",
"value": {
"stringArray": {
}
}
},
"AttachmentPath": {
"key": "AttachmentPath",
"value": {
"stringArray": {
}
}
},
"To": {
"key": "To",
"value": {
"stringArray": {
"stringValues": ["$Recipients$"]
}
}
},
"BodyFormat": {
"key": "BodyFormat",
"value": {
"stringValue": "text"
}
},
"EmailConfigInput": {
"key": "EmailConfigInput",
"value": {
"jsonValue": "{\n \"@type\": \"type.googleapis.com/enterprise.crm.eventbus.proto.EmailConfig\"\n}"
}
},
"Subject": {
"key": "Subject",
"value": {
"stringValue": "$Email_Subject$"
}
}
},
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
"displayName": "Send Email"
}],
"integrationParameters": [{
"key": "EmailContent",
"dataType": "STRING_VALUE",
"defaultValue": {
"stringValue": ""
},
"displayName": "EmailContent",
"inputOutputType": "IN"
}, {
"key": "Recipients",
"dataType": "STRING_VALUE",
"defaultValue": {
"stringValue": ""
},
"displayName": "Recipients",
"inputOutputType": "IN"
}, {
"key": "Email_Subject",
"dataType": "STRING_VALUE",
"defaultValue": {
"stringValue": ""
},
"displayName": "Email_Subject",
"inputOutputType": "IN"
}]
}
코드 샘플: 기본 통합
{
"triggerConfigs": [{
"label": "API Trigger",
"startTasks": [{
"taskId": "1"
}],
"properties": {
"Trigger name": "ForEachLoopDemo_API_1"
},
"triggerType": "API",
"triggerNumber": "1",
"triggerId": "api_trigger/ForEachLoopDemo_API_1"
}],
"taskConfigs": [{
"task": "SubWorkflowForEachLoopV2Task",
"taskId": "1",
"parameters": {
"iterationElementMapping": {
"key": "iterationElementMapping",
"value": {
"stringValue": "EmailContent"
}
},
"aggregatorParameterMapping": {
"key": "aggregatorParameterMapping"
},
"triggerId": {
"key": "triggerId",
"value": {
"stringValue": "api_trigger/SubIntegrationSendEmailDemo_API_1"
}
},
"loopMetadata": {
"key": "loopMetadata",
"value": {
"stringArray": {
"stringValues": ["$`Task_1_loopMetadata`$"]
}
}
},
"disableEucPropagation": {
"key": "disableEucPropagation",
"value": {
"booleanValue": false
}
},
"listToIterate": {
"key": "listToIterate",
"value": {
"stringValue": "$ListOfEmailContent$"
}
},
"workflowName": {
"key": "workflowName",
"value": {
"stringValue": "SubIntegrationSendEmailDemo"
}
},
"requestParameterMapping": {
"key": "requestParameterMapping",
"value": {
"jsonValue": "{\n \"@type\": \"type.googleapis.com/enterprise.crm.eventbus.proto.ParameterMap\",\n \"entries\": [{\n \"key\": {\n \"literalValue\": {\n \"stringValue\": \"Recipients\"\n }\n },\n \"value\": {\n \"literalValue\": {\n \"stringValue\": \"Recipients\"\n }\n }\n }, {\n \"key\": {\n \"literalValue\": {\n \"stringValue\": \"Email_Subject\"\n }\n },\n \"value\": {\n \"literalValue\": {\n \"stringValue\": \"Email_Subject\"\n }\n }\n }]\n}"
}
},
"overrideParameterMapping": {
"key": "overrideParameterMapping"
}
},
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
"displayName": "For Each Loop"
}],
"integrationParameters": [{
"key": "`Task_1_loopMetadata`",
"dataType": "JSON_VALUE",
"displayName": "`Task_1_loopMetadata`",
"isTransient": true,
"producer": "1_1"
}, {
"key": "Recipients",
"dataType": "STRING_VALUE",
"defaultValue": {
"stringValue": ""
},
"displayName": "Recipients",
"inputOutputType": "IN"
}, {
"key": "Email_Subject",
"dataType": "STRING_VALUE",
"defaultValue": {
"stringValue": ""
},
"displayName": "Email_Subject",
"inputOutputType": "IN"
}, {
"key": "ListOfEmailContent",
"dataType": "STRING_ARRAY",
"defaultValue": {
"stringArray": {
"stringValues": ["\"Content 1\"", "\"Content 2\"", "\"Content 3\"", "\"Content 4\""]
}
},
"displayName": "ListOfEmailContent",
"inputOutputType": "IN"
}]
}
샘플 통합 흐름
다음 이미지는 이 통합 코드 샘플에 대한 통합 편집기의 샘플 레이아웃을 보여줍니다.
하위 통합
기본 통합
샘플 통합 업로드 및 실행
샘플 통합을 업로드하고 실행하려면 다음 단계를 수행합니다.
- 통합 샘플을 .json 파일로 시스템에 저장합니다.
- Google Cloud 콘솔에서 Application Integration 페이지로 이동합니다.
Application Integration으로 이동
- 탐색 메뉴에서 통합을 클릭합니다. 통합 목록 페이지가 나타납니다.
- 기존 통합을 선택하거나 통합 만들기를 클릭하여 새 통합을 만듭니다.
새 통합을 만드는 경우:
- 통합 만들기 대화상자에 이름과 설명을 입력합니다.
- 통합 리전을 선택합니다.
- 통합을 위한 서비스 계정을 선택합니다. 통합 툴바의 info 통합 요약 창에서 언제든지 통합에 대한 서비스 계정 세부정보를 변경하거나 업데이트할 수 있습니다.
- 만들기를 클릭합니다.
통합 편집기 페이지에서 통합이 열립니다.
- 통합 편집기에서 publish업로드/다운로드 메뉴를 클릭한 후 통합 업로드를 선택합니다.
- 파일 브라우저 대화상자에서 1단계에서 저장한 파일을 선택한 후 열기를 클릭합니다.
업로드된 파일을 통해 새 버전의 통합이 생성됩니다.
- 통합 편집기에서 테스트를 클릭합니다.
- 통합 테스트를 클릭합니다. 그러면 통합이 실행되고 통합 테스트 창에 실행 결과가 표시됩니다.