When creating an object via an API as part of an import, it is possible that you might encounter some race conditions where the import returns successfully, but the new object is not fully written yet to the application by the time integrator.io queries it in the lookup. The lookup could then fail with the error “Object not found.”
To work around this issue, you can insert a delay before the lookup by adding a dummy lookup flow step before it. This dummy could just look up something harmless and not impact the results, or you can look up something that would never have results.
To test whether the record is available via the lookup, you could try first doing an initial lookup in the postSubmit function of the import (using our API via JS) to see if this makes the problem worse. The postSubmit runs immediately after the import runs, while the lookup likely runs 15 seconds later. In case the script fails, you could keep the dummy lookup flow step in place as a secondary fallback (with a filter to ignore objects where the script worked). The script could run the lookup a couple of times and also return debug information to help you troubleshoot.
We do not recommend adding a JS loop because we already have timeouts and instruction count limits in our JS runtime, so this will likely not be helpful and will also slow down your flow.
Please sign in to leave a comment.