docs
docs copied to clipboard
Update job writing docs
Description Improvements for job writing guide docs.
We don't want to encourage developers to write credentials in job code, Authentication should be handled by the adaptor it self. The current content is bad practices
- [x] Add a debugging section
### Debugging
- Use `console.log()` liberally during development
- Test with small data sets first
- Use the OpenFn CLI to test locally
- Check compiled code with `openfn compile` if needed
Should we add this ? 🤔
## Common Pitfalls to Avoid
1. **Nested Operations** - Always keep operations at top level
2. **Forgetting to Return State** - Every callback must return state
3. **Reading State Too Early** - Use `$` or arrow functions
4. **Not Handling Errors** - Add error handling for production code
5. **Bloated Final State** - Clean up state before job completion
6. **Hardcoded Values** - Use configuration or state for dynamic values
7. **Complex Callbacks** - Break complex logic into multiple operations