diff --git a/integrations/hubspot/integration.definition.ts b/integrations/hubspot/integration.definition.ts index 5d3b726058a..46eb2b34503 100644 --- a/integrations/hubspot/integration.definition.ts +++ b/integrations/hubspot/integration.definition.ts @@ -6,7 +6,7 @@ export default new IntegrationDefinition({ name: 'hubspot', title: 'HubSpot', description: 'Manage contacts, tickets and more from your chatbot.', - version: '6.0.7', + version: '6.0.8', readme: 'hub.md', icon: 'icon.svg', configuration: { diff --git a/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts b/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts index 16bfabd655c..7f931c38295 100644 --- a/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts +++ b/integrations/hubspot/src/webhook/handlers/oauth-wizard.ts @@ -43,7 +43,23 @@ const HITL_SCOPES = [ 'files', ] -const _startStep: oauthWizard.WizardStepHandler = async ({ client, ctx, query, responses }) => { +const _startStep: oauthWizard.WizardStepHandler = async ({ + client, + ctx, + query, + selectedChoice, + responses, +}) => { + if (selectedChoice) { + await client.setState({ + type: 'integration', + name: 'hitlSetupWizard', + id: ctx.integrationId, + payload: { enableHitl: selectedChoice === 'with-hitl' }, + }) + return responses.redirectToStep('oauth-redirect') + } + const environmentPayload = { source: query.get('source') ?? undefined, env: z.enum(['preview', 'production']).catch('preview').parse(query.get('env')),