Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting a method to stop harvesting data. #1345

Open
ruk93 opened this issue Jan 26, 2025 · 1 comment
Open

Requesting a method to stop harvesting data. #1345

ruk93 opened this issue Jan 26, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@ruk93
Copy link

ruk93 commented Jan 26, 2025

Summary

For MicroAgents/BrowserAgent, introducing a method like agent.stop(); is beneficial for micro-frontend projects where sub-paths (in SPAs) are managed by different engineering teams. For example, this feature would allow running multiple agents to independently track specific route paths (e.g., /one-path/* and /two-path/*) without causing conflicts or duplicating data harvesting. The agent.stop() method can be used to stop data collection when the user navigates away from a particular route group.

Desired Behavior

Example scenario

  • user setup BrowserAgent or MicroAgent with auto_start=false
  • user manually start agent when required conditions met.
  • user manually stop agent when conditions are no longer valid.
  • user should be able to restart agent without loosing session id when conditions met again.
  • harvested data should not contain data from outer context.

Possible Solution

  • introduce stop() methods to agent instance ( MicroAgent and BrowserAgent)
  • update start() method to start harvesting if agent is previously stopped.

Additional context

This feature would allow running multiple agents to independently track specific route paths (e.g., /one-path/* and /two-path/*) without causing conflicts or duplicating data harvesting. The agent.stop() method can be used to stop data collection when the user navigates away from a particular route group.

Example React Component Implementation

const MicroApp = () => {

useEffect(() => {
    const agent = new MicroAgent(...); // or BrowserAgent
    // start agent on mount
    agent.start();
    // stop agent on unmount
    return () => {
        agent.stop();
    }
},[]);

return <Component/>
}
@ruk93 ruk93 added the enhancement New feature or request label Jan 26, 2025
@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant