Originally posted by **Haider-Ali-DS** June 7, 2023
Hey i want to add data to offchain-storage from asynchronous task running in `task_manager`. i tried to use runtime_api to get access to pallet calls and then tried adding data to offchain_storage but its not working as expected and giving error.
```
Thread 'tokio-runtime-worker' panicked at 'Accessing a forbidden API: local_storage_set. No: OFFCHAIN_DB_WRITE capability.', /Users/abc/.cargo/git/checkouts/substrate-7e08433d4c370a21/7c195bf/primitives/core/src/offchain/mod.rs:520
```
my main concern is to add data `onchain db` (submit extrinsic) from asynchronous task and for that, I am trying to use offchain_worker for submitting transactions.
By using ```task_manager_service -> runtime_api -> pallet_call(add offchain_data) -> offchain_worker(getdata) -> submit extrinsic```
Any guide how can i achieve my end goal or any working approach for this problem?
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Discussed in https://github.com/paritytech/substrate/discussions/14319