docs icon indicating copy to clipboard operation
docs copied to clipboard

Update job writing docs

Open mtuchi opened this issue 2 months ago • 1 comments

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

Image
  • [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

mtuchi avatar Oct 21 '25 13:10 mtuchi

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

mtuchi avatar Oct 21 '25 13:10 mtuchi