Salesforce Decode
Salesforcedecode
Back to questions
ApexIntermediatefuturequeueablemigration

Migrate legacy @future methods to Queueable without breaking integrations

Real World Scenario

Org has 40 @future(callout=true) methods called from triggers and Visualforce. Leadership wants Queueable for better monitoring and chaining without dual-write bugs.

Expected Answer

• Inventory all @future entry points and callers before migration • Wrapper method delegates to Queueable preserving original signature during transition • Queueable supports callouts and job chaining unlike @future limitations • Cannot invoke @future from @future—map existing chains before refactor • AsyncApexJob visibility replaces blind @future fire-and-forget • Deprecation timeline: log callers still hitting @future path • Test enqueue from trigger context with Test.stopTest() pattern

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Direct answer: Inventory all @future entry points and callers before migration Also consider: Wrapper method delegates to Queueable preserving original signature during transition In practice: Queueable supports callouts and job chaining unlike @future limitations Balance speed of delivery with maintainability.

Architect Perspective

@future is legacy async—migrate incrementally with wrapper compatibility layer.