I was using a workflow to change file names to some text and the SP ID, but this has caused issues because the workflows can often take several minutes to complete. I would like to do this during ItemAdding, but I'm 99.999% sure this isn't possible since the ID probably isn't assigned until the document is uploaded. I think I might use ItemAdded, but I don't know how long that might take to kick off. Are either of these reasonable ideas?
This sort of task is more suited to an event receiver. The itemAdded approach will certainly give you access to the ID. An event receiver does not have the typical delay you see with Workflows, it fires right away.
One issue you can experience with ItemAdded events is that they run asynchronously. What this means is that the control is returned to the UI while the Event Receiver is kicked off. This can cause situation where the event receiver is not quite done processing before the display returns to the user, and they won't see the updated values until they refresh the page.
The solution to this is to set the mode for the ItemAdded event receiver to Synchronous in the Elements.xml file for the event receiver using :
<Receiver> <Name>Test_ListEventReceiversItemAdded</Name> <Type>ItemAdded</Type> <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly> <Class>TestEventReceivers.Test_ListEventReceivers.Test_ListEventReceivers</Class> <Synchronization>Synchronous</Synchronization> <SequenceNumber>10000</SequenceNumber> </Receiver>
With the Synchronous mode, the display won't return to the user until the processing is complete.