Hi, Could we schedule a brief session with a Desc...
# ask-a-descoper
d
Hi, Could we schedule a brief session with a Descoper? We are currently designing a flow involving tenant creation via Descope and need some guidance on best practices. Specifically, we want to pass certain values to a generic HTTP connector, which will then trigger an external API. We want to ensure we are handling the data passing between the initial API call and the connector correctly. We’d appreciate your insights on the best way to structure this
r
Hi @David Elmakias Can we schedule brief session call at 6 pm IST?
d
Hi @Rahul Rijhwani Thanks for your response. Is it possible to make it 17:30? @Dar Nachmani will be joining us as well
r
Hi @David Elmakias Let me check if any other team member will assist you on your preferred time
r
17:30 israeli time?
I am available from now aswell @David Elmakias if you want to meet earlier
🙌 1
d
@Dar Nachmani Are you currently free?
d
Yes
d
joining
r
Hey David, you need to trigger the mgmt flow with the node sdk to pass the tenant to the flow
Copy code
const g = await descopeClient.management.flow.run('flow-id', {tenant: 'xxx'});
inside, you can access the data like this:
d
Does the python sdk support it as well?
r
not yet, i can add support for this if needed. what's your ETA on this task?
d
Probably, a week ago 😅
Does that mean we would have to fallback to using server to server communication and not use the flow?
r
yes, currently the context is being populated only when explicitly sending the tenant id in the flow.run function.
i can either add the python functionality, or if you prefer, i will ask internally about the context with the event trigger. it will take more time to achieve.
d
We would really appreciate having this feature in the python SDK We will implement it currently by creating the tenant and then communicating with our other node server. Can you give us an estimation for this feature?
r
I can have it done by the end of the week
d
That would be great. We'll try and buy ourselves some extra time here. Waiting for your update 🙌 Thank you for the quick response
r
Copy code
# Import the classes
from descope import DescopeClient
from descope.management.common import FlowRunOptions
import sys
    
def main():

    descopeClient = DescopeClient(
        project_id=os.getenv("DESCOPE_PROJECT_ID"),
        management_key=os.getenv("DESCOPE_MANAGEMENT_KEY")
        )

    options = FlowRunOptions(tenant="xxx")
    d = descopeClient.mgmt.flow.run_flow("flow-id", options=options)
    print(d)
🙌 1
d
is it the latest stable ? can we simply update to 1.9.0 ?
r
yes
d
That's awesome thank you for the quick release Just to sum up we need to: 1. Create custom tenant attributes 2. create the management flow and define the body (and on the start should we use "trigger ..." ) 3. call descopeClient.mgmt.flow.run_flow 4. so the flow won't be triggered automatically - it will be triggered from the python code -> then in our flow we'll have HTTP connector which will pass on the values to our next server. Left a question there and - Did I miss anything?
r
Sounds good. If you are stuck at any step - let me know.
✅ 1