What type to extend for plugin that does not hold the completion of a build?

What is the correct way to write a plugin that provides a scripted pipeline step that runs without holding completion of a build? The step might take a very long time to complete, it would update some persistent data related to the build, but it should never hold the completion of the build nor would it alter its status.

Its been a while for me but I’m pretty sure you store data on a build using a custom run action.

As for collecting the data. If you essentially want an async start and stop I think the step class has overridable start and end functions for any sort of wrapper type step.i can probably pull up an example from past jobs.

Or you could use a run listener if you didn’t want to map a wrapping step. Buildwrapper class might also be an option but I think that’s freestyle not pipeline.