Skip to content

feat(runtime): add reset executable endpoint#6738

Merged
johnBgood merged 4 commits into
mainfrom
feat/6028-inbound-connector-reset-endpoint
Apr 28, 2026
Merged

feat(runtime): add reset executable endpoint#6738
johnBgood merged 4 commits into
mainfrom
feat/6028-inbound-connector-reset-endpoint

Conversation

@johnBgood
Copy link
Copy Markdown
Collaborator

@johnBgood johnBgood commented Mar 20, 2026

Description

This pull request introduces several improvements and refactorings to the inbound connector runtime, focusing on making the querying and management of connector executables more flexible and robust. The changes include replacing the immutable ActiveExecutableQuery record with a mutable, builder-style class, updating the query API to use this new approach, and adding the ability to reset (deactivate and reactivate) connector executables via the REST API. Additionally, the handling of connector responses and activity logs has been streamlined and improved.

Key changes:

Query API and Filtering Improvements

  • Replaced the immutable ActiveExecutableQuery record with a mutable class that uses builder-style setters, allowing for more flexible and readable query construction. The query API now accepts a function to configure the query object, enabling more expressive and composable queries. (ActiveExecutableQuery.java, InboundConnectorRestController.java, InboundExecutableQueryService.java) [1] [2] [3] [4]

  • Added support for filtering by executableId in queries, improving the precision of executable lookups. (ActiveExecutableQuery.java, InboundExecutableQueryService.java) [1] [2]

Executable Lifecycle Management

  • Added a new REST endpoint to reset (deactivate and reactivate) connector instance executables, enabling runtime recovery and reconfiguration without manual intervention. (InboundInstancesRestController.java)

  • Refactored the executable activation and deactivation logic: extracted activation into a doActivate method, split out single/batch deactivation, and introduced a robust reset mechanism (restartFromContext) with retry support. (BatchExecutableProcessor.java) [1] [2] [3] [4] [5]

Response and Data Handling

  • Updated the ActiveInboundConnectorResponse to include a logs field (collection of Activity), ensuring activity logs are available in API responses. (ActiveInboundConnectorResponse.java, ConnectorDataMapper.java) [1] [2] [3]

  • Simplified the ConnectorDataMapper by removing the specialized webhook data mapping logic and always returning all connector-level properties. (ConnectorDataMapper.java)

Minor and Supporting Changes

  • Made ExecutableId.fromHashedId public to support its use in the new query API. (ExecutableId.java)

  • Updated controller methods to remove unnecessary parameters and align with the new query and service method signatures. (InboundInstancesRestController.java) [1] [2] [3]

These changes collectively improve the maintainability, flexibility, and robustness of the inbound connector management subsystem.

Related issues

closes #6737

Checklist

  • Backport labels are added if these code changes should be backported. No backport label is added to the latest
    release, as this branch will be rebased onto main before the next release. Example backport labels:
    • backport stable/8.8: for changes that should be included in the next 8.8.x release.
    • or backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and this
      release has already been created. The release branch will be merged back into stable/8.8 later, so the change
      will be included in future 8.8.x releases as well.
  • Tests/Integration tests for the changes have been added if applicable.

@johnBgood johnBgood self-assigned this Mar 20, 2026
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from a9af052 to 65694f1 Compare March 20, 2026 12:53
@johnBgood johnBgood requested a review from chillleader March 23, 2026 09:14
@johnBgood johnBgood marked this pull request as ready for review March 23, 2026 16:36
@johnBgood johnBgood requested a review from a team as a code owner March 23, 2026 16:36
Copilot AI review requested due to automatic review settings March 23, 2026 16:36
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from 65694f1 to 1283a2d Compare March 23, 2026 16:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a runtime-management capability to manually reset an inbound connector executable via a new REST endpoint, leveraging the existing inbound executable registry and batch processing infrastructure.

Changes:

  • Added POST /inbound-instances/{type}/executables/{executableId}/reset endpoint that triggers an executable reset and returns an ActiveInboundConnectorResponse.
  • Introduced InboundExecutableRegistry.reset(ExecutableId) and implemented it in InboundExecutableRegistryImpl.
  • Added BatchExecutableProcessor.restartFromContext(RegisteredExecutable) helper to restart using an existing executable’s context.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/instances/service/InboundInstancesService.java Adds resetExecutable(...) service method used by the REST endpoint.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/InboundExecutableRegistryImpl.java Implements registry-level reset by restarting an executable from its current state/context.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/InboundExecutableRegistry.java Extends the public registry interface with a reset(ExecutableId) API.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/BatchExecutableProcessor.java Adds restart-from-context convenience method used by reset.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/controller/InboundInstancesRestController.java Exposes the new reset endpoint under /inbound-instances.

Comment thread bundle/default-bundle/src/test/resources/application-local.properties Outdated
@johnBgood johnBgood marked this pull request as draft April 3, 2026 15:23
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from d4c8e61 to 777586e Compare April 15, 2026 12:26
@johnBgood johnBgood marked this pull request as ready for review April 15, 2026 12:26
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch 4 times, most recently from fca2fe5 to 8f4fca1 Compare April 15, 2026 14:19
…set endpoint

Adds a manual reset capability for inbound connector executables:
- POST /inbound-instances/{type}/executables/{executableId}/reset
- Deactivates the current executable and re-activates it with a fresh
  instance while reusing the same context
- Supports Activated and Cancelled states
- Returns the updated ActiveInboundConnectorResponse after reset
- Forwards to the correct runtime instance in multi-instance deployments
Closes #6028
# Conflicts:
#	bundle/default-bundle/src/test/resources/application-local.properties
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from 8f4fca1 to 5c592e8 Compare April 16, 2026 12:24
@johnBgood johnBgood requested a review from Copilot April 17, 2026 07:48
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from 5c592e8 to 1ccf2bb Compare April 20, 2026 15:27
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • artifacts.camunda.com
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)
  • build.shibboleth.net
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)
  • packages.confluent.io
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)
  • repository.jboss.org
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)
  • repository.sonatype.org
    • Triggering command: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.9-10.0.LTS/x64/bin/java --enable-native-access=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@johnBgood johnBgood added the qa:required Will trigger the QA workflow label Apr 22, 2026
@github-actions github-actions Bot temporarily deployed to connectors-feat-6028-inbou-c8sm April 22, 2026 13:32 Destroyed
@Szik
Copy link
Copy Markdown
Contributor

Szik commented Apr 23, 2026

@johnBgood
reset seems to depends on the id only (can use whatever type i want)

should we be concerned that i can reset without authorization?

@johnBgood
Copy link
Copy Markdown
Collaborator Author

should we be concerned that i can reset without authorization?

No, currently we only check the org roles: admin, support agent, owner, developer, and operation engineer should have access to all the resources.

@Szik
Copy link
Copy Markdown
Contributor

Szik commented Apr 24, 2026

okay, and the issue with tye? will you have a seconds look on that?

@johnBgood
Copy link
Copy Markdown
Collaborator Author

@Szik I'll change the endpoint, we don't use the type now, only the executableId, as this ID is self-sufficient

Agent-Logs-Url: https://github.com/camunda/connectors/sessions/330b3d47-05bd-41dc-a7a6-c53ce3f9a1b0

Co-authored-by: johnBgood <1797846+johnBgood@users.noreply.github.com>
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from 31be67a to d91190f Compare April 27, 2026 14:36
@github-actions github-actions Bot temporarily deployed to connectors-feat-6028-inbou-c8sm April 27, 2026 14:36 Destroyed
@johnBgood
Copy link
Copy Markdown
Collaborator Author

@Szik I removed the type path variable from the endpoint 👍

@johnBgood johnBgood added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit 3a63db6 Apr 28, 2026
36 of 39 checks passed
@johnBgood johnBgood deleted the feat/6028-inbound-connector-reset-endpoint branch April 28, 2026 12:22
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This pull request has been included in release 8.10.0-alpha1!

Thank you for your contribution! 🚀

@github-actions github-actions Bot added the version:8.10.0-alpha1 Released in version 8.10.0-alpha1 label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy-preview qa:required Will trigger the QA workflow version:8.10.0-alpha1 Released in version 8.10.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a new endpoint to restart inbound connector instances directly, without redeploying the cluster

8 participants