[RFC] job: Add optional {flags} parameter.

fixes #1574
consider using positive logic:

```
if (as_string) {
   ...
} else {
   ...
}
```