Is there a way to branch based on whether code is being executed in a bursted job?

it seem that burst only work for jobs

Maybe try with Job.WithCode. Using Job.WithCode | Entities | 0.7.0-preview.19
Also maybe make the method static, no idea if that has an impact.