diff --git a/Localize/lang/strings.json b/Localize/lang/strings.json index 746ec9e6fb9..ebfe62e4f83 100644 --- a/Localize/lang/strings.json +++ b/Localize/lang/strings.json @@ -1150,6 +1150,7 @@ "QHdKnm": "Drag and connect nodes to transform", "QIzNzB": "Toggle the agent log panel.", "QKC8fv": "Enter variable name", + "QMuDPI": "Select workflow with an Agent loop", "QMyMOI": "Description", "QNfUf/": "Full screen", "QT4IaP": "Filtered!", @@ -2714,6 +2715,7 @@ "_QHdKnm.comment": "default placeholder text", "_QIzNzB.comment": "Toggle the agent log panel aria label text", "_QKC8fv.comment": "Placeholder for variable name", + "_QMuDPI.comment": "Select workflow with an Agent loop", "_QMyMOI.comment": "Description label", "_QNfUf/.comment": "Full Screen token picker", "_QT4IaP.comment": "Filtered text", diff --git a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumption.tsx b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumption.tsx index a4d841e1164..c318a5fbdbf 100644 --- a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumption.tsx +++ b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumption.tsx @@ -427,6 +427,7 @@ const getDesignerServices = ( ...defaultServiceParams, clientSupportedOperations: [ ['/connectionProviders/workflow', 'invokeWorkflow'], + ['/connectionProviders/workflow', 'invokenestedagent'], ['connectionProviders/xmlOperations', 'xmlValidation'], ['connectionProviders/xmlOperations', 'xmlTransform'], ['connectionProviders/liquidOperations', 'liquidJsonToJson'], diff --git a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumptionV2.tsx b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumptionV2.tsx index 8772309a0aa..79b98dab346 100644 --- a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumptionV2.tsx +++ b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesignerConsumptionV2.tsx @@ -539,6 +539,7 @@ const getDesignerServices = ( ...defaultServiceParams, clientSupportedOperations: [ ['/connectionProviders/workflow', 'invokeWorkflow'], + ['/connectionProviders/workflow', 'invokenestedagent'], ['connectionProviders/xmlOperations', 'xmlValidation'], ['connectionProviders/xmlOperations', 'xmlTransform'], ['connectionProviders/liquidOperations', 'liquidJsonToJson'], diff --git a/apps/Standalone/src/templates/app/TemplatesConsumption.tsx b/apps/Standalone/src/templates/app/TemplatesConsumption.tsx index 56b2b2495c0..85ab95e7521 100644 --- a/apps/Standalone/src/templates/app/TemplatesConsumption.tsx +++ b/apps/Standalone/src/templates/app/TemplatesConsumption.tsx @@ -366,6 +366,7 @@ const getResourceBasedServices = ( ...defaultServiceParams, clientSupportedOperations: [ ['/connectionProviders/workflow', 'invokeWorkflow'], + ['/connectionProviders/workflow', 'invokenestedagent'], ['connectionProviders/xmlOperations', 'xmlValidation'], ['connectionProviders/xmlOperations', 'xmlTransform'], ['connectionProviders/liquidOperations', 'liquidJsonToJson'], diff --git a/libs/designer-v2/src/lib/common/constants.ts b/libs/designer-v2/src/lib/common/constants.ts index 4ce0c037346..6f819729f0f 100644 --- a/libs/designer-v2/src/lib/common/constants.ts +++ b/libs/designer-v2/src/lib/common/constants.ts @@ -979,6 +979,7 @@ export default { SELECT_BATCH_WORKFLOW_ACTION: 'sendtobatch', SELECT_BATCH_WORKFLOW_TRIGGER: 'sendtobatchtrigger', SELECT_MANUAL_WORKFLOW_ACTION: 'invokeworkflow', + SELECT_NESTED_AGENT_WORKFLOW_ACTION: 'invokenestedagent', }, CHANNELS: { INPUT: '-inputchannel-', diff --git a/libs/designer-v2/src/lib/ui/panel/recommendation/azureResourceSelection.tsx b/libs/designer-v2/src/lib/ui/panel/recommendation/azureResourceSelection.tsx index dceb155e539..36ec792d826 100644 --- a/libs/designer-v2/src/lib/ui/panel/recommendation/azureResourceSelection.tsx +++ b/libs/designer-v2/src/lib/ui/panel/recommendation/azureResourceSelection.tsx @@ -64,6 +64,11 @@ export const AzureResourceSelection = (props: AzureResourceSelectionProps) => { id: 'DXwS7e', description: "Select workflow with 'An HTTP Request' trigger", }); + const nestedAgentWorkflowTitleText = intl.formatMessage({ + defaultMessage: 'Select workflow with an Agent loop', + id: 'QMuDPI', + description: 'Select workflow with an Agent loop', + }); const batchWorkflowTitleText = intl.formatMessage({ defaultMessage: 'Select a Batch Workflow resource', id: 'gvDMuq', @@ -213,6 +218,21 @@ export const AzureResourceSelection = (props: AzureResourceSelectionProps) => { break; } + case Constants.AZURE_RESOURCE_ACTION_TYPES.SELECT_NESTED_AGENT_WORKFLOW_ACTION: { + setTitleText(nestedAgentWorkflowTitleText); + setResourceTypes(['agentWorkflow']); + setGetResourcesCallbacks(() => [() => SearchService().getAgentWorkflows?.()]); + setSubmitCallback(() => () => { + addResourceOperation({ + name: getResourceName(selectedResources[0]), + presetParameterValues: { + 'host.workflow.id': selectedResources[0].id, + }, + }); + }); + break; + } + case Constants.AZURE_RESOURCE_ACTION_TYPES.SELECT_BATCH_WORKFLOW_ACTION: { setTitleText(batchWorkflowTitleText); setResourceTypes(['batchWorkflow', 'trigger']); @@ -244,6 +264,7 @@ export const AzureResourceSelection = (props: AzureResourceSelectionProps) => { swaggerFunctionAppTitleText, getOptionsFromPaths, manualWorkflowTitleText, + nestedAgentWorkflowTitleText, operation.id, selectedResources, ]); diff --git a/libs/designer/src/lib/common/constants.ts b/libs/designer/src/lib/common/constants.ts index ea7b2511943..96ea9766ee5 100644 --- a/libs/designer/src/lib/common/constants.ts +++ b/libs/designer/src/lib/common/constants.ts @@ -984,6 +984,7 @@ export default { SELECT_BATCH_WORKFLOW_ACTION: 'sendtobatch', SELECT_BATCH_WORKFLOW_TRIGGER: 'sendtobatchtrigger', SELECT_MANUAL_WORKFLOW_ACTION: 'invokeworkflow', + SELECT_NESTED_AGENT_WORKFLOW_ACTION: 'invokenestedagent', }, CHANNELS: { INPUT: '-inputchannel-', diff --git a/libs/designer/src/lib/ui/panel/recommendation/azureResourceSelection.tsx b/libs/designer/src/lib/ui/panel/recommendation/azureResourceSelection.tsx index 2a287ee49bc..d8c06ab5b79 100644 --- a/libs/designer/src/lib/ui/panel/recommendation/azureResourceSelection.tsx +++ b/libs/designer/src/lib/ui/panel/recommendation/azureResourceSelection.tsx @@ -62,6 +62,11 @@ export const AzureResourceSelection = (props: AzureResourceSelectionProps) => { id: 'DXwS7e', description: "Select workflow with 'An HTTP Request' trigger", }); + const nestedAgentWorkflowTitleText = intl.formatMessage({ + defaultMessage: 'Select workflow with an Agent loop', + id: 'QMuDPI', + description: 'Select workflow with an Agent loop', + }); const batchWorkflowTitleText = intl.formatMessage({ defaultMessage: 'Select a Batch Workflow resource', id: 'gvDMuq', @@ -210,6 +215,21 @@ export const AzureResourceSelection = (props: AzureResourceSelectionProps) => { break; } + case Constants.AZURE_RESOURCE_ACTION_TYPES.SELECT_NESTED_AGENT_WORKFLOW_ACTION: { + setTitleText(nestedAgentWorkflowTitleText); + setResourceTypes(['agentWorkflow']); + setGetResourcesCallbacks(() => [() => SearchService().getAgentWorkflows?.()]); + setSubmitCallback(() => () => { + addResourceOperation({ + name: getResourceName(selectedResources[0]), + presetParameterValues: { + 'host.workflow.id': selectedResources[0].id, + }, + }); + }); + break; + } + case Constants.AZURE_RESOURCE_ACTION_TYPES.SELECT_BATCH_WORKFLOW_ACTION: { setTitleText(batchWorkflowTitleText); setResourceTypes(['batchWorkflow', 'trigger']); @@ -241,6 +261,7 @@ export const AzureResourceSelection = (props: AzureResourceSelectionProps) => { swaggerFunctionAppTitleText, getOptionsFromPaths, manualWorkflowTitleText, + nestedAgentWorkflowTitleText, operation.id, selectedResources, ]); diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/__test__/__mocks__/builtInOperationResponse.ts b/libs/logic-apps-shared/src/designer-client-services/lib/__test__/__mocks__/builtInOperationResponse.ts index 28aebb6a491..358a7fa17b7 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/__test__/__mocks__/builtInOperationResponse.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/__test__/__mocks__/builtInOperationResponse.ts @@ -1815,6 +1815,27 @@ export const almostAllBuiltInOperations: DiscoveryOperation { + const { httpClient, apiHubServiceDetails } = this.options; + const uri = `/subscriptions/${apiHubServiceDetails.subscriptionId}/providers/Microsoft.Logic/workflows`; + const queryParameters = { + 'api-version': apiHubServiceDetails.apiVersion, + $filter: filter, + }; + const response = await httpClient.get({ uri, queryParameters }); + return response?.value ?? []; + } + + public async getAgentWorkflows(): Promise { + const requestWorkflows = await this.getWorkflows( + "contains(Trigger, 'Request') and (properties/integrationServiceEnvironmentResourceId eq null)" + ); + return requestWorkflows.filter((workflow: any) => { + const triggers = workflow.properties?.definition?.triggers ?? {}; + return Object.values(triggers).some((trigger: any) => trigger.kind?.toLowerCase() === 'agent'); + }); + } +} + +describe('BaseSearchService', () => { + let mockHttpClient: IHttpClient; + let searchService: TestSearchService; + let mockOptions: any; + + beforeEach(() => { + mockHttpClient = { + get: vi.fn(), + post: vi.fn(), + put: vi.fn(), + delete: vi.fn(), + patch: vi.fn(), + dispose: vi.fn(), + }; + + mockOptions = { + httpClient: mockHttpClient, + apiHubServiceDetails: { + subscriptionId: 'test-subscription', + location: 'westus', + apiVersion: '2016-06-01', + }, + }; + + searchService = new TestSearchService(mockOptions); + }); + + describe('getAgentWorkflows', () => { + test('should return only workflows with Agent triggers', async () => { + const mockWorkflows = { + value: [ + { + id: '/workflows/agent-workflow', + name: 'agent-workflow', + properties: { + definition: { + triggers: { + manual: { + type: 'Request', + kind: 'Agent', + }, + }, + }, + }, + }, + { + id: '/workflows/regular-workflow', + name: 'regular-workflow', + properties: { + definition: { + triggers: { + manual: { + type: 'Request', + kind: 'Http', + }, + }, + }, + }, + }, + ], + }; + + vi.mocked(mockHttpClient.get).mockResolvedValue(mockWorkflows); + + const result = await searchService.getAgentWorkflows(); + + expect(result).toHaveLength(1); + expect(result[0].name).toBe('agent-workflow'); + }); + + test('should handle case-insensitive Agent kind matching', async () => { + const mockWorkflows = { + value: [ + { + id: '/workflows/agent-uppercase', + name: 'agent-uppercase', + properties: { + definition: { + triggers: { + manual: { type: 'Request', kind: 'AGENT' }, + }, + }, + }, + }, + { + id: '/workflows/agent-mixedcase', + name: 'agent-mixedcase', + properties: { + definition: { + triggers: { + manual: { type: 'Request', kind: 'AgEnT' }, + }, + }, + }, + }, + ], + }; + + vi.mocked(mockHttpClient.get).mockResolvedValue(mockWorkflows); + + const result = await searchService.getAgentWorkflows(); + + expect(result).toHaveLength(2); + }); + + test('should return empty array when no Agent workflows exist', async () => { + const mockWorkflows = { + value: [ + { + id: '/workflows/regular', + name: 'regular', + properties: { + definition: { + triggers: { + manual: { type: 'Request', kind: 'Http' }, + }, + }, + }, + }, + ], + }; + + vi.mocked(mockHttpClient.get).mockResolvedValue(mockWorkflows); + + const result = await searchService.getAgentWorkflows(); + + expect(result).toHaveLength(0); + }); + + test('should handle workflows with no triggers defined', async () => { + const mockWorkflows = { + value: [ + { + id: '/workflows/no-triggers', + name: 'no-triggers', + properties: { + definition: {}, + }, + }, + ], + }; + + vi.mocked(mockHttpClient.get).mockResolvedValue(mockWorkflows); + + const result = await searchService.getAgentWorkflows(); + + expect(result).toHaveLength(0); + }); + + test('should handle workflows with undefined kind', async () => { + const mockWorkflows = { + value: [ + { + id: '/workflows/no-kind', + name: 'no-kind', + properties: { + definition: { + triggers: { + manual: { type: 'Request' }, + }, + }, + }, + }, + ], + }; + + vi.mocked(mockHttpClient.get).mockResolvedValue(mockWorkflows); + + const result = await searchService.getAgentWorkflows(); + + expect(result).toHaveLength(0); + }); + }); +}); diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/base/search.ts b/libs/logic-apps-shared/src/designer-client-services/lib/base/search.ts index 267b669e94b..e59a25d61ff 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/base/search.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/base/search.ts @@ -343,6 +343,14 @@ export abstract class BaseSearchService implements ISearchService { return this.getWorkflows(`contains(Trigger, 'Request') and (${ISE_RESOURCE_ID} eq null)`); } + public async getAgentWorkflows(): Promise[]> { + const requestWorkflows = await this.getWorkflows(`contains(Trigger, 'Request') and (${ISE_RESOURCE_ID} eq null)`); + return requestWorkflows.filter((workflow: any) => { + const triggers = workflow.properties?.definition?.triggers ?? {}; + return Object.values(triggers).some((trigger: any) => trigger.kind?.toLowerCase() === 'agent'); + }); + } + public async getBatchWorkflows(): Promise[]> { return this.getWorkflows(`contains(Trigger, 'Batch') and (${ISE_RESOURCE_ID} eq null)`); } diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/__tests__/operationmanifest.spec.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/__tests__/operationmanifest.spec.ts new file mode 100644 index 00000000000..4e25a2c1c30 --- /dev/null +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/__tests__/operationmanifest.spec.ts @@ -0,0 +1,125 @@ +import { describe, test, expect, beforeEach, vi } from 'vitest'; +import { ConsumptionOperationManifestService } from '../operationmanifest'; +import type { IHttpClient } from '../../httpClient'; + +describe('ConsumptionOperationManifestService', () => { + let operationManifestService: ConsumptionOperationManifestService; + let mockHttpClient: IHttpClient; + let mockOptions: any; + + beforeEach(() => { + mockHttpClient = { + get: vi.fn(), + post: vi.fn(), + put: vi.fn(), + delete: vi.fn(), + patch: vi.fn(), + dispose: vi.fn(), + }; + + mockOptions = { + apiVersion: '2016-06-01', + baseUrl: 'https://api.example.com', + httpClient: mockHttpClient, + subscriptionId: 'test-subscription', + location: 'westus', + }; + + operationManifestService = new ConsumptionOperationManifestService(mockOptions); + }); + + describe('getOperationInfo', () => { + test('should return correct operation info for workflow type', async () => { + const definition = { + type: 'workflow', + inputs: {}, + }; + + const result = await operationManifestService.getOperationInfo(definition, false); + + expect(result.connectorId).toBe('/connectionProviders/workflow'); + expect(result.operationId).toBe('invokeworkflow'); + }); + + test('should return correct operation info for nestedagent type', async () => { + const definition = { + type: 'nestedagent', + inputs: {}, + }; + + const result = await operationManifestService.getOperationInfo(definition, false); + + expect(result.connectorId).toBe('/connectionProviders/workflow'); + expect(result.operationId).toBe('invokenestedagent'); + }); + + test('should handle case-insensitive nestedagent type', async () => { + const definition = { + type: 'NestedAgent', + inputs: {}, + }; + + const result = await operationManifestService.getOperationInfo(definition, false); + + expect(result.connectorId).toBe('/connectionProviders/workflow'); + expect(result.operationId).toBe('invokenestedagent'); + }); + + test('should return correct operation info for function type without uri', async () => { + const definition = { + type: 'function', + inputs: {}, + }; + + const result = await operationManifestService.getOperationInfo(definition, false); + + expect(result.connectorId).toBe('/connectionProviders/azureFunctionOperation'); + expect(result.operationId).toBe('azureFunction'); + }); + + test('should return correct operation info for function type with uri', async () => { + const definition = { + type: 'function', + inputs: { uri: 'https://example.com/api' }, + }; + + const result = await operationManifestService.getOperationInfo(definition, false); + + expect(result.connectorId).toBe('/connectionProviders/azureFunctionOperation'); + expect(result.operationId).toBe('azureSwaggerFunction'); + }); + }); + + describe('isSupported', () => { + test('should return true for nestedagent operation type', () => { + const result = operationManifestService.isSupported('nestedagent'); + expect(result).toBe(true); + }); + + test('should return true for workflow operation type', () => { + const result = operationManifestService.isSupported('workflow'); + expect(result).toBe(true); + }); + + test('should handle case-insensitive operation types', () => { + const result = operationManifestService.isSupported('NestedAgent'); + expect(result).toBe(true); + }); + }); + + describe('getOperationManifest', () => { + test('should return manifest for invokenestedagent operation', async () => { + const result = await operationManifestService.getOperationManifest('/connectionProviders/workflow', 'invokenestedagent'); + + expect(result).toBeDefined(); + expect(result.properties).toBeDefined(); + }); + + test('should return manifest for invokeWorkflow operation', async () => { + const result = await operationManifestService.getOperationManifest('/connectionProviders/workflow', 'invokeWorkflow'); + + expect(result).toBeDefined(); + expect(result.properties).toBeDefined(); + }); + }); +}); diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/invokeNestedAgent.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/invokeNestedAgent.ts new file mode 100644 index 00000000000..05d8bb875ba --- /dev/null +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/invokeNestedAgent.ts @@ -0,0 +1,84 @@ +import type { OperationManifest } from '../../../../utils/src'; +import { coreBadge } from '../../badges'; +import { invokeWorkflowGroup } from '../operations'; + +export const invokeNestedAgentManifest = { + properties: { + iconUri: invokeWorkflowGroup.properties.iconUri, + brandColor: invokeWorkflowGroup.properties.brandColor, + summary: 'Choose a Logic Apps workflow', + description: 'Send a task to a nested agent workflow in the same region', + + environmentBadge: coreBadge, + + inputs: { + type: 'object', + required: ['host', 'taskMessage'], + properties: { + taskMessage: { + title: 'Task Message', + type: 'string', + description: 'The task message to send to the nested agent', + 'x-ms-visibility': 'important', + }, + host: { + type: 'object', + required: ['workflow'], + properties: { + workflow: { + type: 'object', + required: ['id'], + properties: { + id: { + title: 'Workflow Id', + type: 'string', + }, + }, + }, + }, + }, + }, + }, + inputsLocation: ['inputs'], + isInputsOptional: false, + autoCast: true, + + outputs: { + type: 'object', + properties: { + body: { + title: 'Body', + }, + headers: { + type: 'object', + title: 'Headers', + }, + statusCode: { + type: 'integer', + title: 'Status Code', + }, + }, + }, + isOutputsOptional: false, + includeRootOutputs: true, + + connector: invokeWorkflowGroup, + + settings: { + operationOptions: { + options: ['DisableAsyncPattern', 'DisableAutomaticDecompression'], + scopes: ['action'], + }, + retryPolicy: { + scopes: ['action'], + }, + secureData: {}, + trackedProperties: { + scopes: ['action'], + }, + timeout: { + scopes: ['action'], + }, + }, + }, +} as OperationManifest; diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts index ba27b7d0f0f..320a17439a4 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts @@ -22,11 +22,19 @@ import { selectFunctionManifest } from './manifests/functions'; import { inlineCodeManifest } from './manifests/inlinecode'; import { integrationAccountArtifactLookupManifest } from './manifests/integrationaccountartifactlookup'; import { invokeWorkflowManifest } from './manifests/invokeWorkflow'; +import { invokeNestedAgentManifest } from './manifests/invokeNestedAgent'; import { liquidJsonToJsonManifest, liquidJsonToTextManifest, liquidXmlToJsonManifest, liquidXmlToTextManifest } from './manifests/liquid'; import { rosettaNetEncodeManifest, rosettaNetDecodeManifest, rosettaNetWaitForResponseManifest } from './manifests/rosettanet'; import { selectSwaggerFunctionManifest } from './manifests/swaggerFunctions'; import { xmlTransformManifest, xmlValidationManifest } from './manifests/xml'; -import { functionGroup, functionOperation, invokeWorkflowGroup, invokeWorkflowOperation, swaggerFunctionOperation } from './operations'; +import { + functionGroup, + functionOperation, + invokeWorkflowGroup, + invokeWorkflowOperation, + invokeNestedAgentOperation, + swaggerFunctionOperation, +} from './operations'; import { getBuiltInConnectorsInConsumption } from './search'; import agentloop from './manifests/agentloop'; import a2arequestManifest from './manifests/a2arequest'; @@ -66,6 +74,12 @@ export class ConsumptionOperationManifestService extends BaseOperationManifestSe operationId: invokeWorkflowOperation.id, }; + case 'nestedagent': + return { + connectorId: invokeWorkflowGroup.id, + operationId: invokeNestedAgentOperation.id, + }; + case 'function': return { connectorId: functionGroup.id, @@ -188,6 +202,7 @@ const apimanagementtrigger = 'apimanagementtrigger'; const appservice = 'appservice'; const appservicetrigger = 'appservicetrigger'; const invokeworkflow = 'invokeworkflow'; +const invokenestedagent = 'invokenestedagent'; const sendtobatch = 'sendtobatch'; const batch = 'batch'; @@ -219,6 +234,7 @@ const supportedConsumptionManifestObjects = new Map([ ['azurefunction', selectFunctionManifest], ['azureswaggerfunction', selectSwaggerFunctionManifest], [invokeworkflow, invokeWorkflowManifest], + [invokenestedagent, invokeNestedAgentManifest], [sendtobatch, sendToBatchManifest], [batch, batchTriggerManifest], [as2encode, as2EncodeManifest], diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operations/invokeWorkflow.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operations/invokeWorkflow.ts index dd22baa1a15..c44ce6a5124 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operations/invokeWorkflow.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operations/invokeWorkflow.ts @@ -37,3 +37,26 @@ export const invokeWorkflowOperation = { iconUri, }, }; + +export const invokeNestedAgentOperation = { + id: 'invokenestedagent', + name: 'invokenestedagent', + type: 'nestedagent', + properties: { + api: { + id: '/connectionProviders/workflow', + name: 'connectionProviders/workflow', + displayName: 'Azure Logic Apps', + iconUri, + brandColor, + description: 'Azure Logic Apps', + }, + capabilities: ['azureResourceSelection'], + summary: 'Choose a Nested Agent workflow', + description: 'Send a task to a nested agent workflow in the same region', + visibility: 'Important', + operationType: 'NestedAgent', + brandColor, + iconUri, + }, +}; diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts index 48b52f7f577..9d013fafc35 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts @@ -5,6 +5,7 @@ import type { BaseSearchServiceOptions } from '../base/search'; import type { ContinuationTokenResponse } from '../common/azure'; import type { QueryParameters } from '../httpClient'; import * as OperationsData from './operations'; +import { a2aRequestGroup } from './operations/operationgroups'; const ISE_RESOURCE_ID = 'properties/integrationServiceEnvironmentResourceId'; @@ -93,6 +94,7 @@ export class ConsumptionSearchService extends BaseSearchService { OperationsData.appServiceTriggerOperation, OperationsData.functionOperation, OperationsData.invokeWorkflowOperation, + OperationsData.invokeNestedAgentOperation, OperationsData.sendToBatchOperation, OperationsData.batchTriggerOperation, OperationsData.as2EncodeOperation, @@ -100,6 +102,7 @@ export class ConsumptionSearchService extends BaseSearchService { OperationsData.rosettaNetEncodeOperation, OperationsData.rosettaNetDecodeOperation, OperationsData.rosettaNetWairForResponseOperation, + OperationsData.a2aRequestOperation, ]; return Promise.resolve([...clientBuiltInOperations, ...consumptionBuiltIn]); } @@ -184,6 +187,7 @@ export const getBuiltInConnectorsInConsumption = (): Connector[] => { OperationsData.selectBatchWorkflowGroup, OperationsData.as2Group, OperationsData.rosettaNetGroup, + a2aRequestGroup, ]; return [...clientBuiltInConnectors, ...consumptionBuiltIn]; }; diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/search.ts b/libs/logic-apps-shared/src/designer-client-services/lib/search.ts index 07b29ced969..7cd316e0d2c 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/search.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/search.ts @@ -13,6 +13,7 @@ export interface ISearchService { getBuiltInConnectors(): Promise; getAllOperations(): Promise; getRequestWorkflows?(): Promise[]>; + getAgentWorkflows?(): Promise[]>; getBatchWorkflows?(): Promise[]>; getWorkflowTriggers?(workflowId: string): Promise[]>; getAzureOperationsByPage(page: number): Promise;